• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

date in UTC format

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to get the date in UTC format "yyyy-MM-dd'T'hh.mm.ss 'Z'"?
I know this would work with Calender, DateFormat and Date classes.
The format above prints out the date in 2001-04-04T10.46.23EDT.
But instead of Z I want -05:00 to be printed out.
Please anyone let me know how to get that output.
Thanks
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sapna,
If I guessed it correctly you want to know the time offset from the GMT. The simple option is to get the TimeZone object from your Calendar and then use the methods getOffset() and getRawOffset() to find the diff. with the GMT.
Hope this helps.
Kaustubh.
 
My pie came with a little toothpic holding up this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic