Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By JosAH

Thread: How i get a UAT date format in java ? i need a output for both GMT and UAT time

  1. #1
    n1n
    n1n is offline Member
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Exclamation How i get a UAT date format in java ? i need a output for both GMT and UAT time

    How i get a UAT date format in java ? i need a output for both GMT and UAT time format.
    can you please help me on this by java CODE.

  2. #2
    n1n
    n1n is offline Member
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Default

    hello any one please help me out on this.....

  3. #3
    n1n
    n1n is offline Member
    Join Date
    Aug 2011
    Posts
    3
    Rep Power
    0

    Default

    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

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,304
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by n1n View Post
    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
    I thought UTC and GMT are identical (except for sub-second differences)

    kind regards,

    Jos
    JeffGrigg likes this.
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    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()));
    	}

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,745
    Rep Power
    19

    Default

    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!

  7. #7
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    And he grew impatient when no one replied in six minutes.

  8. #8
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    Quote Originally Posted by n1n View Post
    i need a java code that shows the UTC and GMT date format
    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

  1. converting string (GMT date) to date in US time.
    By JRuyechan in forum New To Java
    Replies: 1
    Last Post: 10-15-2010, 07:07 AM
  2. Replies: 0
    Last Post: 02-22-2010, 01:44 AM
  3. julian date to full date format
    By judy318 in forum New To Java
    Replies: 7
    Last Post: 11-02-2009, 12:17 PM
  4. Java Locale Date Display Diff Format Prob
    By hemanthjava in forum Advanced Java
    Replies: 2
    Last Post: 03-05-2009, 02:05 PM
  5. Time and Date in Java
    By java_fun2007 in forum New To Java
    Replies: 4
    Last Post: 11-06-2007, 07:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •