Java.text.SimpleDateFormat.parse()

This method does too much than I expected, say:
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date d = sdf.parser("00/00/0000");The d would be 1999, Nov. 30.
After hacked the source code and some testing, I found it will roll backward or forward to generate a date. So, 01/32/2000 would become Feb. 01 2000. But I don't think this is a good implementation, as I expect it could throw exceptions at runtime if the string is not a valid time sting. And it's very difficult to debug, since any digit could be parsed!
I think you guys here know what's behind the scene and why it's implemented like this. Any idea? Do you agree that the parse method should throw an exception when the fields of a date string're out of range? Or am I missing something?
Comments are welcomed, and duke dollars're ready for those good answers.

change your code as follows at it will do what you expected in the first places:
<code>
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
sdf.setLenient(false);
Date d = sdf.parser("00/00/0000");
</code>
Spieler

Similar Messages

  • HOWTO improve java.text.SimpleDateFormat.parse() performace?!!

    I am using SimpleDateFormat to parse the dates. The dates I am parsing have the time zone in format "+0500". So I am using the "z" format to parse it.
    After doing some CPU profile tests, it turns out that I am spending 33% of my entire processing time in parsing the time zones!!! Which is obviously too much time. Is there a way to improve performance on the time zone parsing? I made sure that only one SimpleDateFormat object is created when my application is initialized and I only use the parse() method repeatedly - so that the initialization cost would remain minimum.
    Also are there any other implementations of java.text.DateFormat which will perform better?
    Any help greatly appreciated.
    Thanks,
    Yash

    Are you using "z" or "Z". Upper case is right one.

  • Java.util.text.SimpleDateFormat.parse strange behavior

    Wow !
    if I parse "10/14/2002" I get "0/2/2003", that is, the month 14 is considered 12 (december) + 2 additional months and therefore february in the next year!!
    any idea ?
    Paolo Denti
    =============================
    public class Test {
    public static void main(String[] args) {
    java.util.Date testDate = null;
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("dd-MM-yyyy");
    try {
    testDate = formatter.parse("10-14-2002");
    catch (java.text.ParseException e) {
    System.out.println("Data scassata: " + e.getMessage());
    System.exit(1);
    System.out.println(testDate.toString());
    =================================
    prints "Mon Feb 10 00:00:00 CET 2003"

    Tryformatter.setLenient(false);if you do not want this behaviour.

  • Java.text.SimpleDateFormat  with zones

    Hi,
    I have a log file which has a date format as below:
    20091224060656.000000+060
    Wondering if java.text.SimpleDateFormat would be able to parse it properly.I was seeing this API and it didnot have any exact syntax for parsing this kind of date format.
    Please let me know.
    Regards
    Sayan

    sayanb wrote:
    Hi,
    Thank you for the response.The problem is this is one our client's log file which we are trying to parse using the java.text.SimpleDateFormat from our own java application.
    Hence not sure about +060. I guess the part after the . represent the zone , please correct me.But +060 not sure what this means and I dont think java.text.SimpleDateFormat has a way to parse this.
    Please let me know your comments.Uhm, you need to "tell" SimpleDateFormat what the format is, if you don't know how to interpret the format, how are you going to be able to configure SimpleDateFormat. Contact your "client" and make sure you understand the format, then look at the API docs for SimpleDateFormat and hammer out a pattern string for that format. (But I would assume that the "part after the dot" is second fragments (smaller than milliseconds but larger than nanoseconds, about half-way between, what the name for that is, I'm not sure), and that the part with the "plus" is the timezone, probably +060 is the same as +0600.) IOW, you will probably have to "preprocess" the string removing the last three digits before the "plus" and adding a 0 to the end, but that is only a guess.

  • Java.text.SimpleDateFormat millisecond problem...

    When I run this code:
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat();
    formatter.applyLocalizedPattern("yyyy-MM-dd HH:mm:ss.000000");
    java.util.Date date1 = formatter.parse("2001-08-14 13:49:38.000000", new java.text.ParsePosition(0) );
    System.out.println("Date 1 = " + date1);
    formatter.applyLocalizedPattern("yyyy-MM-dd HH:mm:ss.SSS000");
    java.util.Date date2 = formatter.parse("2001-08-14 13:49:38.000000", new java.text.ParsePosition(0) );
    System.out.println("Date 2 = " + date2);
    The output is:
    Date 1 = Tue Aug 14 13:49:38 GMT+01:00 2001
    Date 2 = null
    The only difference is in the localized pattern, date 1 is generated where milliseconds aren't in the localized pattern, date 2 is generated where milliseconds are in the localized pattern.
    Why is date2 null????

    Hi! When you use the second pattern, it appears that "yyyy-MM-dd HH:mm:ss.SSS000" is not an acceptable pattern. However, "yyyy-MM-dd HH:mm:ss.SSS" works. I'd hazard a guess that when you specify milliseconds, only three places are allowed.
    If you used pattern #2 as you had specified originally, a java.text.ParseException is thrown. With the above modification, it works as expected.
    Hope this helps!
    Cheers!

  • Strange problem with SimpleDateFormat.parse method

    I got something strange with this method.
    String pattern = "yyyy/MM/dd";
    String mydate = "2007/00/10";
    SimpleDateFormat formatter = new SimpleDateFormat(pattern);
    Date newdate = formatter.parse(mydate);
    I get "2006/12/10"
    is this correct.

    dongyisu wrote:
    and there no exception get thrown outYes it does. I ran this:
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class DateFormatTest
       public static final String DEFAULT_DATE_FORMAT = "yyyy/MM/dd";
       public static void main(String[] args)
          DateFormat formatter = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
          formatter.setLenient(false);
          for (int i = 0; i < args.length; ++i)
             try
                Date date = formatter.parse(args);
    System.out.println("input: " + args[i] + " date: " + date);
    catch (ParseException e)
    System.err.println(args[i] + " is not a valid date");
    and got this when I input "2007/00/10":
    com.intellij.rt.execution.application.AppMain DateFormatTest 2007/00/10
    2007/00/10 is not a valid date
    Process finished with exit code 0%

  • SimpleDateFormat.parse() causes Unparsable date exception

    I am using SimpleDateFormat to both format and parse date strings. The format is working properly, but parse results in the following exception:
    java.text.ParseException: Unparseable date: "2007-08-31T12:05:05.651-0700"
    at java.text.DateFormat.parse(Unknown Source)
    Here is my code:
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.SZ");
    String dateTime = dateFormatter.format(new Date());
    Date test = dateFormatter.parse(dateTime);
    For testing purposes, I am formatting a date string, and then passing it right back into parse() and I get the exception.
    I am using jre1.5.0_10.
    Thank you for your help.
    -Karen

    You have specified the milliseconds (S) to have a minimum of 1 letter.
    From the API:
    Number: For formatting, the number of pattern letters is the minimum number of digits, and shorter numbers are zero-padded to this amount. For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields.
    If you specify it like this:SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.SSSZ");
    // or like this
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.S Z");it will work.
    Message was edited by:
    dwg

  • Java.text.ParseException:Unparseable date

    Whilst using the DBMS_XMLSave.updateXML procedure I am having problems parsing a date which is the format dd/mm/yy
    I have tried to use the following procedure to set the date format :
    DBMS_XMLSave.setDateFormat(updCtx,'DD/MM/YY');
    Unfortunately it is not working, as the parser still does not recognise the date format, it seems to want the time element.
    please may somebody advise on some possible solutions

    The date formats must match java date formats not Oracle date formats. For a list of valid date formats please check http://java.sun.com/products/jdk/1.1/docs/api/java.text.SimpleDateFormat.html
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Satvir Ghag ([email protected]):
    Whilst using the DBMS_XMLSave.updateXML procedure I am having problems parsing a date which is the format dd/mm/yy
    I have tried to use the following procedure to set the date format :
    DBMS_XMLSave.setDateFormat(updCtx,'DD/MM/YY');
    Unfortunately it is not working, as the parser still does not recognise the date format, it seems to want the time element.
    please may somebody advise on some possible solutions<HR></BLOCKQUOTE>
    null

  • SimpleDateFormat Parse date

    import java.text.SimpleDateFormat;
    class Datum 
         public Datum()
              java.util.Date datum = null;
              SimpleDateFormat formatter = new SimpleDateFormat("dd-mm-yyyy");
              try
                     datum =  formatter.parse("15-08-2006");
                     System.out.println(datum.toString());
              catch(Exception e)
                    e.printStackTrace();
         public static void main( String args[] )
              Datum d =  new Datum();
    }Parse Dosesn't working Correct.As a result I get DAte with JAnuary MOnth always, no metter what iactal date is.
    I use jdk 1.5.0_06
    Please help!!

    SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); // <-- note the uppercase portion...~

  • SimpleDateFormat parses wrong date successfully (lenient = false). Why?

    Hi
    I've got a problem validating date by SimpleDateFormat. Format "yyyy" successfully parses string like "2009-78" into date 01.01.2009. Can you please help me with it?
    Here is my code:
    SimpleDateFormat format = new SimpleDateFormat("yyyy");
    format.setLenient(false);
    String dateStr = "2009-78";
    Date date;
    try {
        date = format.parse(dateStr);
    } catch (ParseException e) {
        date = null;
        e.printStackTrace();
    System.out.println(String.format("String '%s' parsed to date %s", dateStr, date));Output:
    String '2009-78' parsed to date Thu Jan 01 00:00:00 MSK 2009I need an exception to be thrown in such situation. How can I check where the string represents a correct date?
    Thanks for your help.
    Evgeny
    Edited by: su.eug on Apr 13, 2009 12:56 AM

    Read the comments in the API:
    [http://java.sun.com/javase/6/docs/api/java/text/DateFormat.html#parse(java.lang.String)|http://java.sun.com/javase/6/docs/api/java/text/DateFormat.html#parse(java.lang.String)]
    You could try the other overload of parse, if you want to test whether the whole String was used:
    [http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#parse(java.lang.String, java.text.ParsePosition)|http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#parse(java.lang.String,%20java.text.ParsePosition)]
    (Sorry--the second link doesn't go to the right place. There is a version of "parse" with two parameters, which you can use to determine if the whole String was used.)

  • SimpleDateFormat parsing difficulty

    Hello all,
    Recently, I had to parse Strings into Dates using SimpleDateFormat. The difficulty I had was because the Strings had timezone offsets. The code below shows the 3 tests it took to create a Date object of specified TimeZone.
    Test 1
    Fails because I don't set the TimeZone for SimpleDateFormat.
    Test 2
    Works for the first String because the TimeZone matches the timezone in the String.
    Test 3
    Works for all Strings, but is cumbersome because I have to parse the end of the String myself.
    My question is this: Shouldn't SimpleDateFormat parse a String directly into a Date without having you to specify the TimeZone of that Date? This problem was very annoying to solve and goes against logic (at least mine!).
    I'm interested in any thoughts on this matter. Am I being unreasonable, or is this poorly explained in the API?
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.SimpleTimeZone;
    public class DateTests {
         private static String DATE_FORMAT = "yyyyMMddHHmmss.SSSZ";
         private static String[] TEST_DATA = {
              "20020125120434.175+0800",
              "20031101195801.942+0000",
              "20041231000159.999-0536",
              "20050220165427.531-1100"
         private static int MINUTE = 60 * 1000; //in milliseconds
         private static int HOUR = 60 * MINUTE;
         public static void main(String[] args) {
              test1();
              test2();
              test3();
         private static void test1() {
              System.out.println("**** TEST 1 ****\n");
              DateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
              formatter.setLenient(false); //want to check that dates are valid
              for (String dateString : TEST_DATA) {
                   try {
                        Date date = formatter.parse(dateString);
                        System.out.println("Success! The date is: "+date.toString());
                   } catch (ParseException e) {
                        System.out.println(dateString + " has error index of: " + e.getErrorOffset());
              //out of curiousity, lets see the String representation of the current date & time
              Date now = new Date();
              String currentDate = formatter.format(now);
              System.out.println("\nThe current date as a String: "+currentDate);
              System.out.println("\n");
         private static void test2() {
              System.out.println("**** TEST 2 ****\n");
              DateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
              formatter.setLenient(false); //want to check that dates are valid
              //lets make the timezone +0800
              formatter.setTimeZone(new SimpleTimeZone(8 * HOUR, "GMT")); //8 hour offset
              for (String dateString : TEST_DATA) {
                   try {
                        Date date = formatter.parse(dateString);
                        System.out.println("Success! The date is: "+date.toString());
                   } catch (ParseException e) {
                        System.out.println(dateString + " has error index of: " + e.getErrorOffset());
              System.out.println("\nSuccess for the first date. Why? The timezone of the formatter matches the date.");
              System.out.println("\n");
         private static void test3() {
              System.out.println("**** TEST 3 ****\n");
              DateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
              formatter.setLenient(false); //want to check that dates are valid
              for (String dateString : TEST_DATA) {
                   try {
                        //lets set a timezone for each individual date
                        int length = dateString.length();
                        int gmtMinutes = Integer.parseInt(dateString.substring(length-2, length));
                        int gmtHours = Integer.parseInt(dateString.substring(length-4, length-2));
                        int timeZone = gmtMinutes * MINUTE + gmtHours * HOUR;
                        timeZone = dateString.charAt(length-5) == '+' ? timeZone : -timeZone;
                        formatter.setTimeZone(new SimpleTimeZone(timeZone, "GMT"));
                        Date date = formatter.parse(dateString);
                        System.out.println("Success! The date is: "+date.toString());
                   } catch (ParseException e) {
                        System.out.println(dateString + " has error index of: " + e.getErrorOffset());
    }-Muel

    Date objects don't have time zones.
    This is true, my problem was that I needed to parse both the Date and the TimeZone from a String. I got misled by the SimpleDateFormat documentation (the symbol Z), and somehow got the impression that a Date should have an associated TimeZone!
    In hindsight, it is clear that Z should be used for Date strings containing a timezone and that SimpleDateFormat uses the timezone to modify the Date so that it's correct for the timezone of the current machine. If that makes sense!
    -Muel

  • Java.text.ParseException: Unparseable date: "2008-12-16 00:00:00"

    Dear All WebLogic Guru,
    Need your help about the error in our WebLogic Apps Server. Below is the related logs. Hope to hear from you soon.
    ========
    Log snippet:
    ========
    [15:48:02 ] [INFO] [NumberFormatException in TimesheetAddHandler:] null [delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAddHandler.perform(TimesheetOperatorAddHandler.java:77)]
    java.text.ParseException: Unparseable date: "2008-12-16 00:00:00"
    at java.text.DateFormat.parse(DateFormat.java:337)
    at ejb.sessionBeans.gbms.bulkcrg.timesheet.TimesheetOperatorEJB.getOpsDttm(TimesheetOperatorEJB.java:1647)
    at ejb.sessionBeans.gbms.bulkcrg.timesheet.TimesheetOperator_vn72b_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at ejb.sessionBeans.gbms.bulkcrg.timesheet.TimesheetOperator_vn72b_EOImpl.getOpsDttm(Unknown Source)
    at delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAddHandler.perform(TimesheetOperatorAddHandler.java:383)
    at delegate.RequestManager.perform(RequestManager.java:85)
    at delegate.FrontController.processRequest(FrontController.java:241)
    at delegate.FrontController.doPost(FrontController.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sg.com.jp.framework.sso.SingleSignOnFilter.doFilter(SingleSignOnFilter.java:121)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sg.com.jp.util.xss.XssFilter.doFilter(XssFilter.java:57)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:153)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    [15:48:02 ] [INFO] [ScreenManager] Screen ID [TimesheetOperatorViewSvlt] mapped to [JSP/gbms/bulkcrg/timesheet/TimesheetOP_details.jsp] [delegate.ScreenManager.nextScreen(ScreenManager.java:60)]
    [15:48:02 ] [INFO] Next Screen is : /JRPA(or ServletContext@27549577[app:47jrpa module:JRPA path:/JRPA spec-version:null],WebLogic Server 10.3.4.0 Fri Dec 17 20:47:33 PST 2010 1384255 Oracle WebLogic Server Module Dependencies 10.3 Thu Oct 28 06:03:12 PDT 2010 Oracle WebLogic Server on JRockit Virtual Edition Module Dependencies 10.3 Thu Sep 23 15:02:15 PDT 2010 )/JSP/gbms/bulkcrg/timesheet/TimesheetOP_details.jsp [delegate.FrontController.processRequest(FrontController.java:322)]
    [15:48:02 ] [DEBUG] 2nd funcName in doFilter = TimesheetOP_details [uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:83)]
    [15:48:02 ] [DEBUG] #########new admin framework ########## Function Code = [uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:92)]
    [15:48:02 ] [DEBUG] Function Code = [uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:108)]
    Status :S
    [15:48:03 ] [DEBUG] Contains Function: true TimesheetOperatorSuperAmend [tags.ACLTag.doAfterBody(ACLTag.java:132)]
    [15:48:03 ] [DEBUG] Contains Function: true TimesheetOperatorSuperDelete [tags.ACLTag.doAfterBody(ACLTag.java:132)]
    [15:48:03 ] [DEBUG] Contains Function: true TimesheetOperatorClose [tags.ACLTag.doAfterBody(ACLTag.java:132)]
    [15:48:31 ] [DEBUG] 2nd funcName in doFilter = TimesheetOperatorSuperAmend [uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:83)]
    [15:48:31 ] [DEBUG] Function Code = F27052 [uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:108)]
    [15:48:31 ] [DEBUG] Logged In?: true [delegate.helper.System.AuthenticationHandler.valid(AuthenticationHandler.java:571)]
    [15:48:31 ] [INFO] [RequestManager] Request ID [TimesheetOperatorSuperAmend] mapped to [delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler] [delegate.RequestManager.perform(RequestManager.java:77)]
    [15:48:31 ] [INFO] [RequestManager] delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler Created [delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler@66d4bf] [delegate.RequestManager.perform(RequestManager.java:82)]
    [15:48:31 ] [INFO] performing request delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler@66d4bf [delegate.RequestManager.perform(RequestManager.java:84)]
    [15:48:31 ] [INFO] [NumberFormatException in TimesheetAddHandler:] null [delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler.perform(TimesheetOperatorAmendHandler.java:96)]
    [15:48:31 ] [ERROR] java.lang.StringIndexOutOfBoundsException: String index out of range: 2
    at java.lang.String.substring(String.java:1934)
    at delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler.perform(TimesheetOperatorAmendHandler.java:110)
    at delegate.RequestManager.perform(RequestManager.java:85)
    at delegate.FrontController.processRequest(FrontController.java:241)
    at delegate.FrontController.doPost(FrontController.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sg.com.jp.framework.sso.SingleSignOnFilter.doFilter(SingleSignOnFilter.java:121)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sg.com.jp.util.xss.XssFilter.doFilter(XssFilter.java:57)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at uiServlet.jponlinecharge.TxnLogFilter.doFilter(TxnLogFilter.java:153)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    [delegate.helper.gbms.bulkcrg.timesheet.TimesheetOperatorAmendHandler.perform(TimesheetOperatorAmendHandler.java:526)]
    [15:48:31 ] [INFO] errorMessage ::: There are some error with your request. Please contact administrator if problem persists. [delegate.FrontController.processRequest(FrontController.java:311)]
    =================
    Application Server Specs:
    =================
    OS: Solaris10 x86
    cat /etc/release
    Oracle Solaris 10 9/10 s10x_u9wos_14a X86
    Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    Assembled 11 August 2010
    RAM: 8GB
    HDD: 70GB
    Apps Server: WebLogic Server Version: 10.3.4.0
    Thank you and have a blessed day.
    Best regards,
    Albert

    Hi,
    Try this
    The reason for this error is that the time format entered is not correct. It should be a date and 24-hour format expressed as mm/dd/yy hh:mm:ss. For example: 07/15/10 14:30:00.
    The WebLogic Server 11g documentation gives instructions for Date/Time format. For details, please refer to
    http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13952/pagehelp/Diagnosticsdiagnosticsviewmetricslogtabletitle.html
    Solution
    However, since you cannot open the Domain Log page again because the console hangs or reports a "Redirect Loop" error, you cannot modify this wrong time format on the console. To resolve this issue, please follow these steps:
    Stop WebLogic Server.
    Go to directory <Domain>/servers/<Server_Name>/data/console
    Either open ConsolePreferences.xml and modify the value of startrange (and/or endrange) to a correctly formatted time, e.g. 07/15/10 14:30:00
    OR
    Delete ConsolePreferences.xml entirely.
    Start Weblogic Server again.
    Regards,
    Kal

  • Parse Exception : java.text.ParseException: Unparseable date

    I have inherited a UDF in some mapping that on the whole, works okay...
    but it throws an error after mapping a few dates:
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    the first few map okay...  then i get the exception.
    the UDF is as follows:
    public String convertDateTimeToUTC(String strDate, Container container) throws StreamTransformationException{
    AbstractTrace trace = container.getTrace();
    Date date=null;
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
    try{
    String dt = strDate;
    date = sdfSource.parse(dt);
    trace.addInfo("Local Date:"+date);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    strDate = sdfDestination.format(date);
    catch(ParseException pe){
    trace.addInfo("Parse Exception : " + pe);
    return strDate;
    can anyone see why this fails after successfully mapping a few fields???

    the first mapping works correctly...
    then we reuse the same fields to map to the additional segments.
    the context is correct as it is trying to pull the same fields in...  it just throw the error with the same data in the same UDF/Function Library but for different segments! :o(
    http://img199.imageshack.us/img199/3104/dateconversion.jpg
    as you can see from the screenshot above, the mapping works in the first instance, then fails on subsequent nodes.

  • Java.text.DecimalFormat is parsing '22.3.6' !

    I'm using DecimalFormat to mask a data entry field.
    When I enter something like 22.3.6, it parses!
    String docString = "22.3.6";
    NumberFormat nFormat = new DecimalFormat();
    float value = nFormat.parse(docString).floatValue();
    System.err.println("value: " + value);
    Gives me:
    value: 22.3
    I was expecting a NumberFormatException.
    I'm running
    build 1.5.0_05-b05
    Should I enter this as a bug?

    I tried yout code and it formats the String the way you wanted:
    public class Test
    public static void main ( String[] args )
    java.text.DecimalFormat df2 = new java.text.DecimalFormat("###########0.00");
    System.out.println(df2.format(java.lang.Float.parseFloat("-3.0")));
    } //End Main
    }

  • Java.text.ParseException :UnparseableDate

    Hi,
    Iam trying to convert a String into Date and that Date in to a customized Date format...,Here it is what iam doing..
    import java.util.*;
    import java.io.*;
    import java.text.*;
    public class str2date
    public static void main(String[] args)
    try
    String mystr="01-03-2003";
         SimpleDateFormat converttodt=new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
         java.util.Date mydt=converttodt.parse(mystr.trim());
         System.out.println("mydt"+mydt);
         String output=converttodt.format(mydt);
         System.out.println(output);
         catch(ParseException e)
         System.out.println(e.toString());
    Error:"java.text.ParseException :UnparseableDate 01-03-2003"
    Can any one help me out... URGENT...,
    Thanks in Advance
    Rao.

    Well, the problem is right in front of you. You're telling it the format of the date is going to be
    yyyy-MM-dd'T'hh:mm:ss
    and then you're giving it the date in a format of
    MM-dd-yyyy
    and wondering why it's not accepting it? If you want to input a date from one format and output it in another you need to create two SimpleDateFormat objects, one to parse the date from a String to a Date object, and a second (or reuse the first with a different parse string) to format the Date and output it as a String.

Maybe you are looking for

  • ซื้อ line sticker ผ่านบัตร แต่ไม่ได้รับสินค้า

    ฉันซื้อ ไลน์ สติกเกอร์ ทางบัตรเคดิตการ์ดของ citibank ทาง itune ได้แจ้งรายละเอียดสินค้้ามาทางเมลล์ ตามรายละเอียดด้านล่าง แต่ขณะนี้ ยังไม่ได้รับสินค้า ใน อีเมลล์ มีดังนี้ Billed To: [email protected] surirat artnarongkorn 119/16 m.4 T.bamleam A.banleam

  • Trouble pasting table into Pages.

    I have been unable to copy a table from Numbers and paste it into a Pages document.  The data gets pasted, but not the formatting and it is also not placed in a table.  I am using Pages '09  and Numbers '08.  What appears to happen is teh text or cel

  • Spot Billing & Collection ?

    Dear SAP Gurus, 1. For both the Spot Billing & Spot collection, we are facing problem(error: RFC not called successfully or  device not connected even if the device is connected) while downloading and uploading the data so we are having to upload the

  • Jobs at OS level..

    How to schedule background jobs at OS level?

  • Changing socket server config at runtime

    Is it possible to modify properties of a socket server at runtime without needing to change the xml? For example, if I wanted to change something like connection-idle-timeout-minutes from 120 to 60, could I do it without modifying the following xml b