Results 1 to 8 of 8
- 08-11-2011, 04:45 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 3
- Rep Power
- 0
- 08-11-2011, 04:51 PM #2
Member
- Join Date
- Aug 2011
- Posts
- 3
- Rep Power
- 0
hello any one please help me out on this.....
- 08-11-2011, 05:02 PM #3
Member
- Join Date
- Aug 2011
- Posts
- 3
- Rep Power
- 0
hello guys sorry its mistake its not a UAT its UTC format... i need a java code that shows the UTC and GMT date format
- 08-11-2011, 06:28 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 08-11-2011, 07:19 PM #5
Member
- Join Date
- Aug 2011
- Posts
- 95
- Rep Power
- 0
If you want ISO 8601 formatting of the current UTC/GMT date and time, try this:
Java Code:private static final String ISO_8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssz"; public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_DATE_FORMAT); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); System.out.println(sdf.format(new Date())); }
- 08-11-2011, 07:47 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Better to just point them to the API I feel.
Providing code to people who insist on getting teh codez just strikes me as unproductive. Feed one and then you get hundreds coming in here...mark my words!
- 08-11-2011, 10:02 PM #7
Member
- Join Date
- Aug 2011
- Posts
- 95
- Rep Power
- 0
And he grew impatient when no one replied in six minutes.
- 08-11-2011, 10:06 PM #8
Member
- Join Date
- Aug 2011
- Posts
- 95
- Rep Power
- 0
Oh, and the best solution would be to use the Joda Time library. It's easier to use and less error prone. And, in essence, it (JSR 310) will be included in Java 8.
See: Joda-Time - ISO8601 calendar system - on Source Forge
Similar Threads
-
converting string (GMT date) to date in US time.
By JRuyechan in forum New To JavaReplies: 1Last Post: 10-15-2010, 07:07 AM -
JAXB: After customizing to Java Date, can I control marshalling to exclude time zone?
By queuetip in forum XMLReplies: 0Last Post: 02-22-2010, 01:44 AM -
julian date to full date format
By judy318 in forum New To JavaReplies: 7Last Post: 11-02-2009, 12:17 PM -
Java Locale Date Display Diff Format Prob
By hemanthjava in forum Advanced JavaReplies: 2Last Post: 03-05-2009, 02:05 PM -
Time and Date in Java
By java_fun2007 in forum New To JavaReplies: 4Last Post: 11-06-2007, 07:25 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks