Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Can someone please help me parse this date

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The date is:



Thank you in advance. I think the 'GMT-0500' is what is giving me the problem.
 
Sheriff
Posts: 22504
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're right about that. Try the following to see exactly where the parsing fails:
You'll see that it fails at the 00. If you add a : before it it will succeed, and print "Thu Dec 01 06:00:00 CET 2011". In other words, 6 AM CET (GMT+1) equals 0 AM EST (GMT-5).
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@OP: Please BeForthrightWhenCrossPostingToOtherSites. Thanks.
 
Rob Hyx
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:You're right about that. Try the following to see exactly where the parsing fails:
You'll see that it fails at the 00. If you add a : before it it will succeed, and print "Thu Dec 01 06:00:00 CET 2011". In other words, 6 AM CET (GMT+1) equals 0 AM EST (GMT-5).



Ah, thanks. That's what I needed. I took a look at the API and it had that ":" in all of the examples for GMT.

Sorry, I did post this on the Oracle forums. I'll remember that in the future.

Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic