- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Java Date/System.currentTimeMillis Not updating on...
Operating System - HP-UX
1753548
Members
5435
Online
108795
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
07-08-2003 12:00 PM
07-08-2003 12:00 PM
Java Date/System.currentTimeMillis Not updating on HPUX ITANIUM
The system date isnt getting incremented using java. The date command at the prompt displays the correct system date and time.
The java class is made to sleep for 2 seconds, create a new date object, and also check the system time..
Both the new Date as well as the System time are not being updated...!!!!
See below for:
- Java Version info
- Output
- Source code
..... Thanks!!!!!
*** version************
[egate@goopy ~/JavaTesting]$ java -version
java version "1.3.1.02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.02-011206-02:17)
Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.02-JPSE_1.3.1.02_20011206 PA1.1, mixed mode)
*** output ****************
[egate@goopy ~/JavaTesting]$ java testTime
Inside testTime
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
*** Source *********************
import java.util.*;
import java.text.SimpleDateFormat;
public class testTime
{
public static void main(String [] args)
{
System.out.println ("Inside testTime");
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 ("DateFormat time = " + df.format(now));
long lTime = System.currentTimeMillis();
System.out.println ("System.currentTimeMillis = " + lTime);
try
{
Thread.sleep (1000);
System.gc();
}
catch (InterruptedException e){}
}
}
}
The java class is made to sleep for 2 seconds, create a new date object, and also check the system time..
Both the new Date as well as the System time are not being updated...!!!!
See below for:
- Java Version info
- Output
- Source code
..... Thanks!!!!!
*** version************
[egate@goopy ~/JavaTesting]$ java -version
java version "1.3.1.02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.02-011206-02:17)
Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.02-JPSE_1.3.1.02_20011206 PA1.1, mixed mode)
*** output ****************
[egate@goopy ~/JavaTesting]$ java testTime
Inside testTime
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
DateFormat time = 2003-07-08 16:02:42.146
System.currentTimeMillis = 1057694562146
*** Source *********************
import java.util.*;
import java.text.SimpleDateFormat;
public class testTime
{
public static void main(String [] args)
{
System.out.println ("Inside testTime");
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 ("DateFormat time = " + df.format(now));
long lTime = System.currentTimeMillis();
System.out.println ("System.currentTimeMillis = " + lTime);
try
{
Thread.sleep (1000);
System.gc();
}
catch (InterruptedException e){}
}
}
}
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2003 02:04 PM
07-09-2003 02:04 PM
Re: Java Date/System.currentTimeMillis Not updating on HPUX ITANIUM
Your test works fine for me using java 1.4.1.
Your "java -version" output looks really strange. It seems that you are running the PA-RISC version of java under Aries emulation mode. You should download a native IPF java from http://www.hp.com/go/java
Your "java -version" output looks really strange. It seems that you are running the PA-RISC version of java under Aries emulation mode. You should download a native IPF java from http://www.hp.com/go/java
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP