DateFormat.parse issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeremy

    #1

    DateFormat.parse issues

    I can't get dates to parse with any accuracy. I have a date like this,
    for example:

    Fri May 25 07:58:46 GMT 2007

    I am using a SimpleDateForma t with a format string of:

    EEE MMM dd HH:MM:SS z yyyy

    When I parse the date and print it back out, it thinks it was:

    Tue Oct 25 02:00:00 CDT 2011

    Which is not even remotely the same except for the "25".

    Any tips on using the date parser? I guess I could just extract all the
    fields into integers and make a date out of that, but it seems like
    there is built-in functionality for this and I want it to work!

    Thanks,
    Jeremy
  • Real Gagnon

    #2
    Re: DateFormat.pars e issues

    Jeremy <jeremy@pinacol .comwrote in news:6%n5i.1140 6$qJ1.8078
    @newsfe18.lga:
    I can't get dates to parse with any accuracy. I have a date like this,
    for example:
    >
    Fri May 25 07:58:46 GMT 2007
    >
    I am using a SimpleDateForma t with a format string of:
    >
    EEE MMM dd HH:MM:SS z yyyy
    >
    When I parse the date and print it back out, it thinks it was:
    >
    Tue Oct 25 02:00:00 CDT 2011
    >
    Your format string is wrong , try :

    EEE MMM dd HH:mm:ss z yyyy

    Bye.
    --
    Real Gagnon from Quebec, Canada
    * Java, Javascript, VBScript and PowerBuilder code snippets
    * http://www.rgagnon.com/howto.html
    * http://www.rgagnon.com/bigindex.html

    Comment

    • Jeremy

      #3
      Re: DateFormat.pars e issues

      Real Gagnon wrote:
      >
      Your format string is wrong , try :
      >
      EEE MMM dd HH:mm:ss z yyyy
      >
      Bye.
      Yep, you're right. Thanks for spotting that.

      Jeremy

      Comment

      Working...