Solved

Piece of code for converting date and time depending on country's

Posted on 2006-06-13
3
192 Views
Last Modified: 2010-03-31


For example , i place my latop in dubai

java code should display time and date of dubai (6/13/06 and time: 12:30p.m)

if united states (6/12/06 time:united states time)



0
Comment
Question by:cutie_smily
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16898318
You need to change the timezone your laptop is setup for.
Your java application will by default display the time using the current timezone.
0
 
LVL 5

Accepted Solution

by:
tbboyett earned 250 total points
ID: 16898978
Locale locale = Locale.US;
java.util.Calendar calendar = java.util.Calendar.getInstance( locale );

http://www.erights.org/javadoc/java/util/Locale.html
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16900640
Yes, the OS time-zone has to be changed and Java will pick it up
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java syntax, or is it Selenium 6 64
Coding for the first time 9 104
Github api to fetch the number of collaborators in a git repo 1 70
Overriding a method 3 15
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question