The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to display date in multiple timezone in Java with Example - PST GMT

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to display date in multiple timezone in Java with Example - PST GMT Posted: Dec 26, 2012 4:57 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to display date in multiple timezone in Java with Example - PST GMT
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
We can use SimpleDateFormat class to display date in multiple Timezone in Java. While working in global Java application its quite common to display dates in different timezone, classical example is Server is running on either PST or GMT timezone and clients are global or at least running on global trading hubs like Hong-kong, Mumbai, Tokyo, London etc. Unfortunately Date and Time API in Java is quite tricky and until you have good understanding of Date and Time classes and methods e.g. Calendar, SimpleDateFormat and thread-safety issue , You can easily create bugs. One of misconception Java programmer has is converting date in different timezone. Actually Date in Java is always in GMT and it represent number of millisecond since 01-01-1970 00:00 and when we print Date, it calls toString method and display date time information in local timezone. If we want to display date in different timezone we can do this by using SimpleDateFormat class in Java. In this Java tutorial we will see couple of example of displaying date in IST and PST timezone.
Read more ยป

Read: How to display date in multiple timezone in Java with Example - PST GMT

Topic: Unix command to find IP address from hostname - Linux example Previous Topic   Next Topic Topic: Performance of inlined virtual method invocations in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use