- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Java displays wrong system time.
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
06-26-2003 01:21 PM
06-26-2003 01:21 PM
# swlist -l bundle
# Initializing...
64-bitDevLibs B.11.00 Cross Platform Development Kit
B6256CA B.11.01.06 HP aC++ Ecom Compiler (S800)
BUNDLE B.11.00 Patch Bundle
HPUXEng32RT B.11.00 English HP-UX 32-bit Runtime Environment
QPK1100 B.11.00.51.01 Quality Pack for HP-UX 11.00 (December 2000)
UXCoreMedia B.11.00 HP-UX Media Kit (Reference Only. See Description)
XSWGR1100 B.11.00.52.2 HP-UX General Release Patches, March 2001
Y2K-1100 B.11.00.B0315 HP-UX Core OS Year 2000 Patch Bundle
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 01:36 PM
06-26-2003 01:36 PM
Re: Java displays wrong system time.
You see the difrence in time that is just like
your time zone difrence if so than is problem
of calculate with the timezone.
Check how the function that you use to get
time work on unix, what she checks and about
the timezone.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 04:55 PM
06-26-2003 04:55 PM
Re: Java displays wrong system time.
All time for HP-UX is kept in GMT (Zulu or UTC) format with no daylight saving jumps. The TZ value causes date/time routines to translate the GMT value using entries in /usr/lib/tztab.
So if you run the Java program from a shell prompt (where date shows correctly) then the Java code should display correctly. Now the question is: how is the Java code run? Is it part of a web page? If so, how is the web server started? In other words, the TZ value must be set for Java (or any executable) to interpret the date/time correctly.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 01:53 AM
06-27-2003 01:53 AM
Re: Java displays wrong system time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 03:39 AM
06-27-2003 03:39 AM
Re: Java displays wrong system time.
your problem is almost certainly due to difference between HP-UX timezones and java timezones.
For example, in HP-UX, MET stands for Middle European Time. However, this stands for Middle East Time in Java.
If your timezone is MET-2METDST, HP-UX will thus think that you're in Europe, while Java will think that you're in the middle-east...
If your problem is this one, you can define by yourself new timezones: check your /usr/lib/tztab file, and your manpage:
http://docs.hp.com/hpux/onlinedocs/B2355-90682/B2355-90682.html
Cheers,
FiX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 05:59 AM
06-27-2003 05:59 AM
Re: Java displays wrong system time.
The problem is not just the time , it shows some day in 2021,22 and so on and a differnt time for each iteration. I will copy the output here.
This is the output from the HP-UX machine working correctly.
# java Test
2003-06-27 09:58:22.817
2003-06-27 09:58:23.082
2003-06-27 09:58:23.343
2003-06-27 09:58:23.602
2003-06-27 09:58:23.862
2003-06-27 09:58:24.122
2003-06-27 09:58:24.382
2003-06-27 09:58:24.642
2003-06-27 09:58:24.902
2003-06-27 09:58:25.163
This is the output from the machine thats not working correctly
# java Test
2015-02-09 18:07:54.494
2015-12-16 15:28:48.494
2016-10-12 14:14:32.494
2017-08-09 12:33:04.494
2018-06-06 11:09:16.494
2019-04-03 07:54:16.494
2020-01-29 06:03:22.494
2020-11-25 04:16:48.494
2021-09-22 03:38:36.494
2022-07-20 05:35:03.494
I dont' have any clues about the output.
Thanx guys
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 06:38 AM
06-27-2003 06:38 AM
Re: Java displays wrong system time.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 06:38 AM
06-27-2003 06:38 AM
Re: Java displays wrong system time.
I would compare the two machines veryt carefully. Same OS "bitness"; exactly the same patch levels even on seemingly unrelated patches.
As a first test, I would also display the output from a method that returns epoch seconds (seconds since 00:00 1 Jan 1970). That would really give you a clue as to whether the time itself is wrong or how it is displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:12 AM
06-27-2003 09:12 AM
Re: Java displays wrong system time.
B8110AA 1.2.2.04.01 Java 2 SDK for HP-UX (700/800), PA1.1 + PA2.0 Add On
I am not able to find this bundle to download. Pls let me know if any of you guys know where to download it from.
Thanx
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 10:32 AM
06-27-2003 10:32 AM
Re: Java displays wrong system time.
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 11:52 AM
06-27-2003 11:52 AM
Re: Java displays wrong system time.
Your Quality Packs are also quite old.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 12:36 PM
06-27-2003 12:36 PM
Re: Java displays wrong system time.
No it could not be problem of hardware!
Did you check more about the command that
you use in java to get a time, some special
dependences of.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 01:26 PM
06-27-2003 01:26 PM
Re: Java displays wrong system time.
import java.util.*;
import java.text.*;
public class Exp
{
public static void main(String [] args)
{
SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss
.SSS");
for (int i=0; i < 10; ++i)
{
Date now = new Date();
System.out.println (df.format(now));
long lTime = System.currentTimeMillis();
System.out.println (lTime);
try
{
Thread.sleep (256);
}
catch (InterruptedException e) {}
}
}
}
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2003 05:49 AM
06-30-2003 05:49 AM
Re: Java displays wrong system time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2003 01:16 PM
06-30-2003 01:16 PM
Re: Java displays wrong system time.
I cann't see something wrong in the source
so for now i had no ideas.
Caesar