SimpleDateFormat can parse MMddyy wrong without error???

Discussion in 'Java' started by caultonpos@gmail.com, Feb 16, 2008.

  1. Guest

    Java 1.6 I execute the following code:

    SimpleDateFormat sdf = new SimpleDateFormat("MMddyy");
    Date d = sdf.parse("013355");

    and it returns the date

    Wed Feb 02 00:00:00 EST 1955


    no parse exception?

    What am I missing?

    Greg
     
    , Feb 16, 2008
    #1
    1. Advertising

  2. On 2008-02-16 02:11 +0100, allegedly wrote:
    > Java 1.6 I execute the following code:
    >
    > SimpleDateFormat sdf = new SimpleDateFormat("MMddyy");
    > Date d = sdf.parse("013355");
    >
    > and it returns the date
    >
    > Wed Feb 02 00:00:00 EST 1955
    >
    >
    > no parse exception?
    >
    > What am I missing?


    <http://java.sun.com/javase/6/docs/api/java/text/DateFormat.html#setLenient(boolean)>
    <http://java.sun.com/javase/6/docs/api/java/util/Calendar.html#setLenient(boolean)>
     
    Daniele Futtorovic, Feb 16, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manuel
    Replies:
    0
    Views:
    572
    Manuel
    Aug 28, 2003
  2. Niko
    Replies:
    10
    Views:
    2,517
    Wojtek
    Sep 18, 2003
  3. Replies:
    0
    Views:
    389
  4. Replies:
    2
    Views:
    2,493
  5. weiwei

    date format mmddyy in asp???

    weiwei, May 14, 2004, in forum: ASP General
    Replies:
    1
    Views:
    141
    DLBJR
    May 15, 2004
Loading...

Share This Page