Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-06-13
3
Medium Priority
?
196 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 750 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

926 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