This discussion is archived
3 Replies Latest reply: Dec 7, 2012 1:15 AM by Sushant Sharma RSS

date conversion and formatting

user539616 Explorer
Currently Being Moderated
Hello all,

I'm literally getting confused with these dates in OAF. When i'm dealing with validating with dates or passing to a plsql package, or converting from one format to another. Can anyone please explain me the logic on how to deal with these dates?

Thanks a lot for your help.

--KK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 1. Re: date conversion and formatting
    Shrikant A Explorer
    Currently Being Moderated
    hi,
    Please create Object of java.sql.Date while passing the date to pl/sql package.
    And if pl/sql package returns Date it will return
    Oracle.jbo.domain.date
    Please refer following API for Oracle.jbo.domain.date.
    http://docs.oracle.com/cd/E14571_01/apirefs.1111/e10655/oracle/jbo/domain/Date.html



    --
    Thanks,
    Shrikant
    s.a.aughad@gmail.com

    Edited by: Shrikant A on Dec 5, 2012 8:53 AM
  • 2. Re: date conversion and formatting
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    Refer below links for date conversions:

    http://anuj-oaframeworkblog.blogspot.in/2009/08/jbo-date-conversion-in-oaf.html
    http://mystuffoaf.blogspot.in/2012/01/converting-string-object-to-date-object.html?zx=23e02e9a214265d7
    http://ioracle-erp.blogspot.in/2011/09/oaf-string-to-sql-date.html
    http://oracleanil.blogspot.in/2009/04/plsql.html

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 3. Re: date conversion and formatting
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    An example of String to date conversion:

    String dateInString = "December 7, 2012";
    SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
    Date formattedDate = dateFormat.parse(dateInString);

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points