Java get wrong time zone on redhat 6.6
location: linuxexchange.com - date: May 6, 2015
My java application worked well on Redhat 6.5 but it get wrong time zone on Redhat 6.6.
I'm on /usr/share/zoneinfo/Asia/Ho_Chi_Minh. I tried to figure out and realized that the content on /etc/localtime is different with /usr/share/zoneinfo/Asia/Ho_Chi_Minh. I checked on Redhat 6.5 and saw that /etc/localtime and /usr/share/zoneinfo/Asia/Ho_Chi_Minh are identical. Then I copied /usr/share/zoneinfo/Asia/Ho_Chi_Minh from 6.5 to 6.6 and my application work well.
My question is: Did anyone get this issue?
Is there any other solution without copying /usr/share/zoneinfo/Asia/Ho_Chi_Minh from 6.5 to 6.6?
[SOLVED] Java giving wrong time
location: ubuntuforums.com - date: September 16, 2007
Ok, this is on Debian Etch so not really Ubuntu but I think I'll ask anyway as it's likely someone is able to give me a good answer...
I am setting up a Java web application on my new Debian server, and running into an oddity with Java's time. System time and timezone are correct as far as I know:
Your default time zone is set to 'Europe/Helsinki'.
Local time is now: Sun Sep 16 07:25:02 EEST 2007.
Universal Time is now: Sun Sep 16 04:25:02 UTC 2007.
However, with Java code that essentially does System.out.println(new Date()) we get:
voitto:~# java Testi
Sun Sep 16 06:30:45 GMT+02:00 2007
So Java is an hour behind -- This is going to be a total showstopper for this deployment until it is resolved
Nothing like this on my Ubuntu development box! It probably has something to do with summer time, but no idea how to fix this...
Setting System Time: kernel in wrong time zone
- date: April 15, 2002
I'm having a problem setting system time. Actually, it seems that the kernel time is in UTC, while the "system" is in the correct timezone.
When I type 'date', I get the correct system time, e.g., as of this
Thu Apr 11 19:48:02 MDT 2002
But, when I edit or create a file, the timestamp is 6 hours in the
future, or UTC:
/root]# touch testfile
/root]# ls -alF test*
-rw-rw-r-- 1 root root 0 Apr 12 01:49 testfile
My /etc/zoneinfo file points to the correct timezone file:
lrwxrwxrwx 1 root root 34 Apr 12 01:54 /etc/localtime -> /usr/sh
Plus, my /etc/sysconfig/clock file seems to be set correctly:
I run a script in /etc/cron.daily to first set the system time from a
timeserver, then set the hardware clock to local time:
#Script to set time
/usr/bin/rdate -s clock.psu.ed
How to get Time Zone information from the system
location: linuxquestions.com - date: September 13, 2004
Please let me know how to get the Time Zone information from the system,
In windows platform we use Windows API for the same.
Please let me know if any Linux API is available for the same.
I have a C++ Class through which I want to get TimeZone Information of the system.
Please let me know how can I proceed
Thanks in Advance
how to get time offset from time zone
location: linuxquestions.com - date: April 9, 2009
programatically, how can we get the time offset from the time zone information?
NTP time zone wrong
location: ubuntuforums.com - date: March 20, 2011
since the upgrade tzdata (2011c-0ubuntu0.10.04) to 2011d-0ubuntu0.10.04
which I installed on Saturday, ntp updates seem to put me in GMT time.
I've switched to manual time settings, as it does horrific things to my mythtv database!
I'm not sure if its the upgrade, or the ntp time servers. My timezone is Australia/Tasmania.
Java Time Zone is messed up
location: linuxexchange.com - date: November 26, 2013
I am running a Tomcat application, and I need to display some time values. Unfortunately, the time is coming up an hour off. I looked into it and discovered that my default TimeZone is being set to:
Rather than the Pacific time zone. This is further indicated when I try to print the default time zone's display name, and it comes up "GMT-08:00", which seems to indicate to me that it is not correctly set to the US Pacific time zone. I am running on Ubuntu Hardy Heron, upgraded from Gutsy Gibbon.
Is there a configuration file I can update to tell the JRE to use Pacific with all the associated daylight savings time information? The time on my machine shows correctly, so it doesn't seem to be an OS-wide misconfiguration.
Ok, here's an update. A coworker suggested I update JAVA_OPTS in my /etc/profile to include "-Duser.timezone=US/Pacific", which worke
Get GMT Time in Java
location: linuxexchange.com - date: March 19, 2013
In Java, I want to get the current time in GMT.
I tried various options like this:
Date date = new Date();
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
date1 = calendar.getTime();
But the date is always is interpreted in my local time zone.
What am I doing wrong and how can I convert a java Date to GMT?
How do you get info for an arbitrary time zone in Linux / POSIX?
location: linuxexchange.com - date: October 11, 2012
Ideally, what I'd like to be able to do is take the name of a time zone and call a function to ask for its corresponding time zone info (offset from UTC, DST offset, dates for DST switch, etc.) in Linux. However, I can't find any way to do this. The information exists in /usr/share/zoneinfo/ in the various binary files there, but I don't know how to read them or if there is a way to get the OS to give you the information in them rather than having to read them in yourself. So, I'm looking for a way to get this information. Ideally, there would be a posix function which would do it for you so that it would work on POSIX systems other than Linux, but if there isn't, I'd at least like to know the proper way (or at least the best way) to get the time zone info for an arbitrary time zone in Linux.
Get time zone information of the system in Python?
location: linuxexchange.com - date: July 22, 2014
I want to get the default timezone (PST) of my system from Python. What's the best way to do that? I'd like to avoid forking another process.
Page: 1 2 3 4 5 6 7 8 9 10