- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get rigth time in Java running on HP-UX?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 02:59 AM
08-01-2006 02:59 AM
The Java has problems returning the rigth time when summertime daylight saving is on ( in winter is OK... ). There is ONE hour difference between real time and java system time ). There are no such problems on other UNIX OS , e.g. Sun Solaris.
How I can get the rigth time , without sofisticated workarounds , when using Java processes on HP-UX.
Thank you in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 03:03 AM
08-01-2006 03:03 AM
Re: How to get rigth time in Java running on HP-UX?
date
command ? If so, your /etc/TIMEZONE file may have a problem. As an example, mine looks this way and and I am on the west coast of USA
# cat /etc/TIMEZONE
TZ=PST8PDT
export TZ
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 03:34 AM
08-01-2006 03:34 AM
Re: How to get rigth time in Java running on HP-UX?
echo Time from HP-UX shell:
date
echo "***********"
java -classpath /users/mis107/user/dev/weblogic Test
The content of the class Test.java is the following:
import java.util.Date;
public class Test{
public static void test(){
System.out.println("Time from java program :"+new Date());
}
public static final void main(String[] args) {
test();
}
}
Here is the output of the script
mis107-weblogic #time_test.sh
Time from HP-UX shell:
Tue Aug 1 18:28:01 IDT 2006
***********
Time from java program :Tue Aug 01 17:28:02 GMT+02:00 2006
Please notice the ONE hour difference ( I don't care about the one second difference )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 03:49 AM
08-01-2006 03:49 AM
Solution"What's your time zone?
Get a handle on Java date and time classes" might prove useful:
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 05:38 AM
08-01-2006 05:38 AM
Re: How to get rigth time in Java running on HP-UX?
Make sure your system gets the right time and Java is properly patched. That really should be the end of it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 10:23 PM
08-01-2006 10:23 PM
Re: How to get rigth time in Java running on HP-UX?
Run Java using JVM parameter -Duser.timezone with the suitable time zone. For a list with available time zones see this link :
http://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/adrtzval.htm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 10:25 PM
08-01-2006 10:25 PM