Convert time in miliiseconds to date format

I have a column in my table with datatype number(38,0) , in that column i have values in form of miliseconds since 1970 e.g 1152567973042...
i have a requirement to convert this time in milliseconds to today's date, which i can do as
1152567973042 / 3600 / 24 / 365 == x
1970 + x = today's date
is there a function in oracle supporting this, or i have to customize my requirements and write a function.
Thanks in anticipation

Your function will not work precisely because it does not account for leap years. You should use Oracle date math. If you add a number to an Oracle date datatype, it assumes that the number is in days. Oracle will automatically account for leap years. Try this:
DECLARE
mydate DATE;
milliseconds_since_1970 NUMBER(30,7);
BEGIN
milliseconds_since_1970 := ?;
mydate := TO_DATE( '01-JAN-1970', 'DD-MON-YYYY') + milliseconds_since_1970/(1000*60*60*24);
DBMS_OUTPUT.PUT_LINE('mydate = ' || to_char( mydate, 'DD-MON-YYYY HH24:MI:SS' ) );
END;
This converts your milliseconds (replace ? with the number) to days and then adds the days to January 1, 1970. The result is an Oracle date datatype adjusted for leap years.
Oracle date datatypes have hours, minutes, and seconds. Since these were not specified for 1/1/1970, they default to zero. Since milliseconds_since_1970 has 7 decimal places, it will contain fractional days which Oracle converts to hours, minutes, and seconds.
I'm not sure what format Oracle stores date datatypes in. You have to convert them with a format string every time you use them.
Kevin Tyson

Similar Messages

  • How to convert parameter in to proper date format in unix.

    My requirement is to convert parameter string (012011) as a date in unix without support from other like sql. then once it is converted into date format how to increment it by one day. Here i want to use my own date rather than system timestamp of unix system. Please help.
    I am unix HP unix 11.

    Moderator Action:
    Your question is outside the scope of this Linux forum space, and is locked.
    You seem to hope for assistance with a specific Unix that is a product from a specific company.
    I suggest you go to that company's forum community and ask there.  You will undoubtedly find many people there that are familiar with the nuances if that OS.

  • Converting the string value to data format

    Hello Everyone,
                                  Please guide me in converting the value to date format.
    from source i'm getting the value (which is acchally a data value) '20070730'.
    I need this value to be in date format '2007/07/30'
    Please help me in getting it done.
    thank you

    Hi
    Code Snippetselect cast('20070730' as datetime)
    Note : beware of collation used in your SQL instance or your database.
    Jean-Pierre

  • How to convert a string into orcle date format

    i need some information about converting string into date format.i have string like '20-SEP-05' .so we have to convert into date formate like yy-mm-dd' (2005-09-20).how can we do it.

    Here's some code to help. I can't remember what method uses what format though
      public static java.sql.Date sqlDateValueOf( String dateString ) {
        String stringDate = null;
        if ( dateString == null || dateString.length() < 10 ) return null;
        String strDay = "";
        String strMonth = "";
        String strYear = "";
        if ( dateString.substring(4,5).equals( "-" ) ) {
          strDay = dateString.substring(8, 10);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(5, 7);
          strMonth = dateString.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(0, 4);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        else if ( dateString.substring(2,3).equals( "-" ) ) {
          strDay = dateString.substring(0, 2);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(3, 5);
          strMonth = String.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(6, 10);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        Calendar cal = Calendar.getInstance();
        cal.set( Calendar.YEAR, Integer.parseInt( strYear ) );
        cal.set( Calendar.MONTH, Integer.parseInt( strMonth ) );
        cal.set( Calendar.DAY_OF_MONTH, Integer.parseInt( strDay ) );
        java.sql.Date outDate = new java.sql.Date( cal.getTimeInMillis() );
        return outDate;
      public static String toDateString( java.util.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date, String format) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat( format );
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Timestamp date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      }

  • Converting Oracle 7-Byte Internal Date FOrmat to MM/DD/YYYY format.

    I can get the date stored in the database in 7-Byte Internal representation.
    I want to convert this number to mm/dd/yyyy format,using PRO*C-SQLDA(Method 4),overriding any NLS DATE Format.
    null

    Only Oracle Spatial questions
    here please.
    null

  • Needed help regarding converting  string to java.sql.Date format

    I have a a function which returns a calendar object. The date must be inserted to Oracle DB using java.sql.Date format.
    So i have converted the Calendar object to java.sql.Date format using the following code
    java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());But while getting inserted into the DB it was in mm/dd/yyyy format whereas i wanted dd/mm/yyyy format
    Can any body please help out how to store the date in dd/mm/yyyy format ?

    Can u please explain this a bit
    This is my code
    public int addBook(List<Book> BookList) throws SQLException, ParseException{
              System.out.println("Hi there");
              Book book = new Book();
              BookDB bookDb = new BookDB();
              //listLength =      BookList.length;
              String bookId = null;
                   try{
                        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                        con  = DriverManager.getConnection("jdbc:oracle:thin:@10.123.79.195:1521:findb01","e115314", "e115314");
                        addBook = con.prepareStatement("insert into ABC_Book values(?,?,?,?,?,?,?)");
                        Iterator<Book> iterator = BookList.iterator();
                        while(iterator.hasNext()){
                             book = (Book)iterator.next();
                             System.out.println(book.getBookId());
                             addBook.setString(1,book.getBookId());
                             addBook.setString(2,book.getTitle());
                             addBook.setString(3,book.getAuthor());
                             addBook.setString(4,book.getPublisher());
                             System.out.println(book.getPublicationDate());
                             System.out.println("Before Date");
                             System.out.println("book.getPublicationDate().getTime()"+book.getPublicationDate().getTime());
                             java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());
                             SimpleDateFormat formatter = new SimpleDateFormat("dd/mm/yyyy");
                             dateString = formatter.format(publicationDate);
                             System.out.println("Today is"+dateString);
                             java.sql.Date date = (java.sql.Date)formatter.parse(dateString);
                             System.out.println("date"+date);
                             //java.sql.Date publicationDate = (Date)book.getPublicationDate().getTime();
                             //System.out.println("Value of date is"+publicationDate);
                             System.out.println("After Date");
                             addBook.setDate(5,publicationDate);
                             addBook.setString(6,book.getCountry());
                             addBook.setString(7,book.getLanguage());
                             rs = addBook.executeQuery();
                             //con.commit();
                             rowCount = rowCount + rs.getRow();
                        return rowCount;
                   catch(SQLException se){
                        se.printStackTrace();
                   finally{
                        con.close();
                        System.out.println("After adding ");
              return 0;
         }

  • Converting a string into mySQL date format

    I have a bit of code that collects data values from a bean and I want it to then insert this into a mySQL database. My string is in the format "23/12/1983", how can i put this into a date field in my database? The bit of code I have got so far looks like this...
    String month = formHandler.month + "/";
    String day = formHandler.day + "/";
    String year = formHandler.year ;
    StringBuffer sb = new StringBuffer();
    sb.append(day);
    sb.append(month);
    sb.append(year);
    String myDate = sb.toString();myDate is the value that I want to go into the database

    Limo2kz,
    The key to inserting a date into a database is to convert the date string into an SQL friendly format. i.e. yyyy-MM-dd.
    One way of doing this is as follows:
    SimpleDateFormat NICE_DATE_FORMAT =
    new SimpleDateFormat("dd/MM/yyyy");
    SimpleDateFormat SQL_DATE_FORMAT =
    new SimpleDateFormat("yyyy-MM-dd");
    Date date = new Date();
    try {
    date = NICE_DATE_FORMAT.parse(dateString);
    } catch (ParseException pe) {
    pe.printStackTrace();
    String sqlDate = SQL_DATE_FORMAT.format(date);
    Now it is just a matter of creating the insert statement like normal, and making sure that the date string is in quotes.
    I hope that helps.
    Damian Sutton

  • Converting from milliseconds to a date format in java

    This so that, that date can be inserted into a date column in mysql
    What I have is something like 1119193190
    I do:
    SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");
    Date resultdate = new Date(yourmilliseconds);
    System.out.println(sdf.format(resultdate));
    and Java gives me something like:
    Jul 04,2004 14:06
    But Java then when inserting into a mysql table is all like um....no:
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: 'Jul 04,2004 14:06' for column 'prodDate' at row 1
    proDate is of type date in mysql.
    Help?

    jverd wrote:
    "Jul 04,2004 14:06" is a String, not a Date.
    PreparedStatement ps = conn.prepareStatement("insert into T(name, birthdate) values(?, ?)");
    ps.setString(1, "Joe Smith");
    java.sql.Date date = new java.sql.Date(yourmillis);
    ps.setDate(2, date);
    ps.executeUpdate();
    I am a bit confused
    This i what I have
    for(int i = 0; i < productions.size(); i++)
                        //Create a new Production from the ArrayList
                        Production p = (Production) productions.get(i);
                        //Convert the date from milliseconds to YYYY-MM-DD format. for mysql?
                        SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd,yyyy HH:mm");
                        Date convertedDate = new Date(p.getDate());
                        //Build a query to insert the Production into the table
                        String insertQuery = "INSERT INTO WELL_PROD VALUES(" +
                                  "'" + p.getLocation() + "'," +
                                  "'" + dateFormatter.format(convertedDate) + "'," +
                                  "'" + p.getOilProd() + "'," +
                                  "'" + p.getWaterProd() + "'," +
                                  "'" + p.getGasProd() + "')";
                        //Print the query to the screen
                        System.out.println("-> INSERTING the following query into well_prod: ");
                        System.out.println("   " + insertQuery);
                        //Update the database using the constructed query
                        int result = statement.executeUpdate(insertQuery);
                        //Print out the result of the insertion
                        System.out.println("   INSERT RESULT: " + result);
                   }Are you saying something like
    java.sql.Date date = new java.sql.Date(Something , what I have no idea, Should go here);
    instead of
    SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd,yyyy HH:mm");
    and then carry on as normal?
    If so, what should go in those brackets based on the code?
    java.sql.Date date = new java.sql.Date("MMM dd,yyyy HH:mm");
    This is all being read in from a text file and converted over before being spit out to the data base, it all works except for the date...

  • Convert string (in a Julian Date format) to a date in CR XI Release 2

    How do you convert a string field  entered in a database as a Julian date " 10109 , 09008. ,,," to
    print on a report as  date?
    09008 would be 01/08/09
    10109                 04/19/10

    A small correction to Brian's formula:
    NumberVar myYear;
    NumberVar myDays;
    myYear := ToNumber( {table.JULIAN} [1 to 2]);
    myDays := TONUMBER({table.JULIAN} [3 to 5]);
    (Date (myYear, 1, 1) + myDays) - 1;
    The result for '09008' will be 01/08/9, by adding ToText, you can get the result in the desired format of 01/08/09.
    totext((Date (myYear, 1, 1) + myDays) - 1, "MM/dd/yy");
    Here is an alternate solution without having to create variables:
    totext(dateserial(tonumber(X[1 to 2]),1,tonumber(X[3 to 5])),"MM/dd/yy");
    where X is the julian date in string.
    Edited by: Sanjay Kodidine on Apr 20, 2010 8:25 AM

  • How to convert a String("yyyy-mm-dd") to the same but in Date format ?

    Hi,
    can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
    coding:
    public String dateconvertion(String strDate)
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
    Date date = sdfSource.parse(strDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
    strDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    return(strDate);
    }

    i used prepared statement even now i am getting error like this.....
    i have included the prepared statement package also...
    my coding:
    ResultSet rsdatetemp = null;
    PreparedStatement ps = null;
    String query ="select distinct itemcode from sales where bill date between ? and ?";
    ps = precon.prepareStatement(query);
    ps.setDate(1,d1);//d1 and d2 are in date format
    ps.setDate(2,d2);
    rsdatetemp = ps.executeQuery();
    error :
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(1,d1);
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(2,d2);

  • String conversion gives error when converting to date format

    Hello,
    I need to convert a character to a date format. The character string is 201053131415151 where the first eight characters represent YYYYMMDD. The string may also be null ( second value). I used the following select statement
    select distinct sysdate "Run Date",
    rcreviewdate "Review Date",
    nvl((to_char(substr(rcreviewdate,1,8))),'None') "Review Date2"
    and got the following result.
    Run Date Review Date Review Date2
    30-NOV-09 201005131415151 20100513
    30-NOV-09
    1. Why is "None" not returned for the secord valule which is null?
    2. How can the valule "20100513" be converted to DD-MON-YY ( the date format)?
    to_date(substr(rcreviewdate,1,8),'YYYYMMDD') gives the following error with the null value
    Error report:
    SQL Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0
    01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"

    Hi,
    PANY wrote:
    1. Why is "None" not returned for the secord valule which is null?
    2. How can the valule "20100513" be converted to DD-MON-YY ( the date format)?
    to_date(substr(rcreviewdate,1,8),'YYYYMMDD') gives the following error with the null value
    Error report:
    SQL Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0
    01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"Are you sure reviewdate is NULL, and not a string consisting only of spaces or tabs?
    TO_DATE will return NULL if its 1st argument is NULL, so it looks like reviewdate is not NULL.
    You can use LTRIM (among other functions) to remove spaces from reviewdate, if that's the problem.
    Post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.

  • Converting .DAT format to IPOD

    Hi,
    I've been trying to convert some movies recorded in .DAT format for personal viewing in my Ipod. Pix transfer OK but No sound. Trid using both QT Pro and Handbrake but same problem remain.
    Can anyone provde me a pointer?
    Thanks

    Your .DAT files are really MPEG 1 format and QuickTime Pro can't export the audio from muxed formats.
    MPEG Streamclip (free) can convert the file to QT formats and even has an "export to iPod" preset.

  • Handling Date Format

    Hi Everyone,
    I am using DB 11g and Apex 4.1 Versions.
    We are working on a project where most of the time we would be uploading CSV through Apex and store the data in DB using some procedures developed by us and most of the time we get different date formats in the CSV which is sent by the client. It is the major issue which i encounter in my carrer.
    Please suggest me how we can handle or tell the procedure to check if one format doesn't work take another if that also doesn't work go for another.
    Any link or code or anything Please help me with this and make my career a bit more easy :)
    Thanks,
    Shoaib

    Hi, Shoaib,
    Shoaib581 wrote:
    Thanks Guys,Pay particular attention to Paul's reply. The people who enter the data are the best people to make sure it is correct. Do whatever you can to ensure valid, consistent data entry. It may be hard for users who want to use their own favorite format, but not as hard as it is to correct mistakes later.
    >
    >
    Your clarification really helped me and made many things clear for me :). Any suggestion, how we can handle if the date format comes in below formats,
    DD-MM-YY OR DD-MON-YY formats. Oracle forgives you if you use 'MON' where 'MM' was expected, so
    TO_DATE ( '1-Dec-2012'
            , 'DD-MM-YYYY'
            )returns Decemer 1, 2012: it WILL NOT raise an error.
    The converse is not true: TO_DATE (str, 'DD-Mon-YYYY') WILL raise an error if you the month part is '12'.
    Here's a package function I wrote to try various formats in turn:
    --          **   t o _ d t   **
    --     to_dt attempts to convert in_txt to a DATE using in_fmt_1_txt.
    --     If that fails, it tries again, using in_fmt_2_txt.
    --     If that fails, it tries again, using in_fmt_3_txt, and so on.
    --     As soon as one conversion works, the function returns the DATE,
    --     and the remaining formats are not tried.
    --     If all the formats given fail, then in_default_dt is returned.
    FUNCTION     to_dt
    (     in_txt          IN     VARCHAR2                    -- string to be converted
    ,     in_fmt_1_txt     IN     VARCHAR2     DEFAULT     'DD-Mon-YYYY'     -- 1st format to try
    ,     in_fmt_2_txt     IN     VARCHAR2     DEFAULT NULL          -- 2nd format to try
    ,     in_fmt_3_txt     IN     VARCHAR2     DEFAULT NULL          -- 3rd format to try
    ,     in_fmt_4_txt     IN     VARCHAR2     DEFAULT NULL          -- 4th format to try
    ,     in_fmt_5_txt     IN     VARCHAR2     DEFAULT NULL          -- 5th format to try
    ,     in_default_dt     IN     DATE          DEFAULT     NULL          -- Returned if nothing works
    RETURN     DATE
    DETERMINISTIC
    IS
         fmt_cnt          PLS_INTEGER     := 5;          -- Number of in_fmt_ arguments
         fmt_num          PLS_INTEGER     := 1;          -- Number of argument being tried
         return_dt     DATE           := NULL;     -- To be returned
    BEGIN
         FOR  fmt_num  IN  1 ..  fmt_cnt
         LOOP
              BEGIN     -- Block to trap conversion errors
                   return_dt := TO_DATE ( in_txt
                                       , CASE     fmt_num
                                              WHEN  1     THEN  in_fmt_1_txt
                                              WHEN  2     THEN  in_fmt_2_txt
                                              WHEN  3     THEN  in_fmt_3_txt
                                              WHEN  4     THEN  in_fmt_4_txt
                                              WHEN  5     THEN  in_fmt_5_txt
                                    END
                   -- If control reaches this point, then TO_DATE worked
                   RETURN     return_dt;
              EXCEPTION
                   WHEN OTHERS
                   THEN
                        IF  SQLCODE  BETWEEN -1865
                                      AND     -1839
                        THEN
                                NULL;
                        ELSE
                             RAISE;
                       END IF;
              END;     -- Block to trap conversion errors
         END LOOP;
         RETURN     in_default_dt;
    END     to_dt
    ;Once again, this will convert a string like '12/11/10' to a DATE. It will not necessarily return the same DATE that was meant by whoever entered the string.

  • Need help - Date format in es Tag / LoadedData

    hi,
    I have one Date attribute called 'EXPIRATION_DATE' in DOCUMENT table.
    I mapped this column entry in 'application-config.xml' as jdbc.column.EXPIRATION_DATE=ExpirationDate;
    And when I am trying to get this value in JSP,within '<es:forEachInArray>' tag
    scope, using the syntax below
    <%
    String strDate = (String)doc.getProperty("LodedDate","ExpirationDate");
    %>
    I am getting different formatted results in different environments
    Like , when I executed this in windows ,
    I got the resulted string as "Mon Jul 07 00:00:00 EDT 2003" , which can be converted
    to 'Date' type
    using <% Date exp_date = new Date(strDate); %> which solves my problem.
    But , when I executed same code to UNIX ,
    I got the resulted string as "2009-02-01 00:00:00.0" , which is not convertible
    to 'Date' format.
    I got the following exception , when I try to convert this resulted String to
    date format like.
    <% Date exp_date = new Date(strDate); %>
    java.lang.IllegalArgumentException
    at java.util.Date.parse(Date.java:585)
    at java.util.Date.<init>(Date.java:267)
    Finally , I need to convert the resulted string to "MMM dd, yyyy" (Feb 22, 2000)format.
    If not above method , what is the best way to get the resulted value in this "MMM
    dd, yyyy" format.
    /***** My Sample code ********/
    <es:forEachInArray array="<%=BankerMsgs%>" id="doc" type="Content" >
    <%String strDate = "";
         strDate = (String)doc.getProperty("LodedDate","ExpirationDate");     //strDate =
    "Mon Jul 07 00:00:00 EDT 2003"; // Windows
         //strDate = "2003-07-07 00:00:00.0"; // UNIX
         out.println("Original Date is :" + strDate); // In windows env I got this formatted
    result 'Mon Jul 07 00:00:00 EDT 2003' and In UNIX I got the string as '2003-07-07
    00:00:00.0'
         SimpleDateFormat formatter = new SimpleDateFormat ("MMM dd, yyyy");
         Date strDate12 = new Date(strDate);
         String strExpDate = "";
         try
              strExpDate = formatter.format(strDate12);
              out.println("Formatted Date is :" + strExpDate); // in windows I got correct
    result as 'Jul 07, 2003' and in UNIX java.lang.IllegalArgumentException
         catch(Exception e) {}
    %>     
    </es:forEachInArray>
    Any help will be much appreciated.
    thanks
    -Amar Purumandla

    hi,
    I have one Date attribute called 'EXPIRATION_DATE' in DOCUMENT table.
    I mapped this column entry in 'application-config.xml' as jdbc.column.EXPIRATION_DATE=ExpirationDate;
    And when I am trying to get this value in JSP,within '<es:forEachInArray>' tag
    scope, using the syntax below
    <%
    String strDate = (String)doc.getProperty("LodedDate","ExpirationDate");
    %>
    I am getting different formatted results in different environments
    Like , when I executed this in windows ,
    I got the resulted string as "Mon Jul 07 00:00:00 EDT 2003" , which can be converted
    to 'Date' type
    using <% Date exp_date = new Date(strDate); %> which solves my problem.
    But , when I executed same code to UNIX ,
    I got the resulted string as "2009-02-01 00:00:00.0" , which is not convertible
    to 'Date' format.
    I got the following exception , when I try to convert this resulted String to
    date format like.
    <% Date exp_date = new Date(strDate); %>
    java.lang.IllegalArgumentException
    at java.util.Date.parse(Date.java:585)
    at java.util.Date.<init>(Date.java:267)
    Finally , I need to convert the resulted string to "MMM dd, yyyy" (Feb 22, 2000)format.
    If not above method , what is the best way to get the resulted value in this "MMM
    dd, yyyy" format.
    /***** My Sample code ********/
    <es:forEachInArray array="<%=BankerMsgs%>" id="doc" type="Content" >
    <%String strDate = "";
         strDate = (String)doc.getProperty("LodedDate","ExpirationDate");     //strDate =
    "Mon Jul 07 00:00:00 EDT 2003"; // Windows
         //strDate = "2003-07-07 00:00:00.0"; // UNIX
         out.println("Original Date is :" + strDate); // In windows env I got this formatted
    result 'Mon Jul 07 00:00:00 EDT 2003' and In UNIX I got the string as '2003-07-07
    00:00:00.0'
         SimpleDateFormat formatter = new SimpleDateFormat ("MMM dd, yyyy");
         Date strDate12 = new Date(strDate);
         String strExpDate = "";
         try
              strExpDate = formatter.format(strDate12);
              out.println("Formatted Date is :" + strExpDate); // in windows I got correct
    result as 'Jul 07, 2003' and in UNIX java.lang.IllegalArgumentException
         catch(Exception e) {}
    %>     
    </es:forEachInArray>
    Any help will be much appreciated.
    thanks
    -Amar Purumandla

  • Converting httpSession creation time to Date format

    I have the need to convert the value returned from httpSession.getCreationTime() to a Date format. The value returned from getCreationTime is long. I need to parse this value into 2 other fields. The first needs to be in year, month, day format. The second must give me the time in hours, minutes, seconds and milliseconds. Thanks in advance for any help you can give me.

    Simple:Date date = new Date(httpSession.getCreationTime())

Maybe you are looking for

  • Difference in quantity during

    Hi All, I have done goods receipt (101 movement type) for exchnage purchase order and later done a reversal (102 movement type). I see a difference in the quantity, even though it is very small change i need to understand what parameters have caused

  • Quicktime Pro 7.3.0 and iMovie 6.0.3

    I am using iMovie HD 6.03 for a DVD project and after the Quicktime update to 7.3.0. - I suddenly have problems with the video clips. After starting up the iMovie program, I can only click on the few two or three clips in the clip viewer and play the

  • AIR 3.1.0.4880 InvokeEvent Defect

    Recently upgraded to the AIR 3.1 SDK and have run into a show stopping issue regarding InvokeEvent on mobile devices.  The application is dispatching a new InvokeEvent each and every time you change orientation on the device.  And it isn't clearing t

  • Sharing custom display profiles between multiple users

    Hello, I'm brand new to Mountain Lion and I can't figure out how to share a custom display profile between multiple users on the same MBP. I'm a photographer and I have two users set up on my laptop - one personal and one for shooting. I'm using a Co

  • Native sql connect to sql server

    hello everyone! my r/3 application server is unix os,versio is 620,I want to connect outer sql server,how can I make it? thanks in advance! if the suggest is helpfull,point will be rewarded.