Results 1 to 5 of 5
Thread: Time Zone Problem on Windows
- 12-24-2009, 12:42 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Time Zone Problem on Windows
I created a simple java test application that echo the time zone and the current date/time (to test Cruise controll problem).
and it prints out the wrong time zone GMT-05:00 instead of GMT+02:00
needless to say the Server I'm running has the right time and Time Zone set.
Running with Java jdk1.6.0_03
On Windows server 2003
output:
Acre Time:
Thu Dec 24 06:24:41 ACT 2009:
where DOS shell prints
>time
The current time is: 13:24:47.33
My script is as follows:
import java.util.Date;
import java.util.TimeZone;
public class TestDate{
public static void main(String[] args){
Date date = new Date();
TimeZone tz = TimeZone.getDefault();
String tzName = tz.getDisplayName(tz.inDaylightTime(date), TimeZone.LONG);
System.out.println(tzName + ": ");
String bla = date.toString();
System.out.println(" " + bla + ":");
}
}
Please advice
- 12-24-2009, 01:53 PM #2
what about if you force the timezone with a Java VM argument:
Except, what ever code is for GMT+2 for youJava Code:java -Duser.timezone=US/Eastern CLASS_NAME
- 12-24-2009, 01:58 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Foring the time Zone
for my little script it is not a problem to set the time Zone but the problem is that
I did this test to test Cruise Control which is written in Java and uses a lot of modules like log4j that I can't control
I'm trying to understand where java takes the odd time zone on the system obviously not directly from the OS
- 12-24-2009, 02:07 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,589
- Blog Entries
- 7
- Rep Power
- 17
It works for me (Java 1.6.0.16) GMT+1; can you (double) check the timezone on the computer you're running that Java application on? (click on the clock in the bottom right corner); I'm not aware of timezone bugs w.r.t. that Acre (Brazilian AST) time.
kind regards,
Jos
- 09-29-2010, 01:38 PM #5
Member
- Join Date
- Sep 2010
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Problem in knowing the status of windows
By sushil in forum Advanced JavaReplies: 1Last Post: 10-05-2009, 09:35 PM -
Problem in knowing the status of windows
By sushil in forum AWT / SwingReplies: 1Last Post: 10-04-2009, 01:48 AM -
Time zone stamp
By ddscart in forum New To JavaReplies: 1Last Post: 08-02-2009, 08:41 PM -
time Zone
By mohammedsiddig in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 09-07-2008, 03:38 PM -
How to install tzdata2007i (updated Time zone database) in JDK 1.5.0_12-b04
By Santhosh in forum Advanced JavaReplies: 0Last Post: 11-06-2007, 02:16 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks