Solved

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

Posted on 2006-06-13
3
188 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now