Re: DateFormat.parse issues



Jeremy <jeremy@xxxxxxxxxxx> wrote in news:6%n5i.11406$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 SimpleDateFormat 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
.



Relevant Pages

  • Re: Kernel marker has no performance impact on ia64.
    ... can hook on a marker and parse the string looking for some elements by ... passing a NULL format string upon probe registration. ... to the marker and a check will be done to verify that the format string ...
    (Linux-Kernel)
  • Re: Kernel marker has no performance impact on ia64.
    ... can hook on a marker and parse the string looking for some elements by ... passing a NULL format string upon probe registration. ... to the marker and a check will be done to verify that the format string ...
    (Linux-Kernel)
  • Re: Kernel marker has no performance impact on ia64.
    ... passing a NULL format string upon probe registration. ... to the marker and a check will be done to verify that the format string ... Then we're asking systemtap to parse potentially general C type ...
    (Linux-Kernel)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)
  • Re: How to parse this timestamp?
    ... gnu.gcc.help schrieb: ... I don't see any way to build a strftime() ... format string that can handle the +216ms part. ... Use string.split to separate the string on the +, then parse the left part with strptime, and usp pytz and datetime.timedelta to do the rest. ...
    (comp.lang.python)