<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic java currentTimeMillis() not OK when date changed while programm running. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656061#M100629</link>
    <description>It seems that a java program running on HP-UX 11iv1 (rp4440, b2600) doesn't see the correct time using currentTimeMillis() if the date command was used to update current time while the program is running. &lt;BR /&gt;&lt;BR /&gt;=&amp;gt; the main class hereafter gets the current time each 5 seconds and prints it to screen. &lt;BR /&gt;- On a XP PC, the date and time is correctly updated after I change it on the desktop while the program is running. &lt;BR /&gt;- On a HP-UX system, the date/time update is not seen !!&lt;BR /&gt;&lt;BR /&gt;This looks like a bug ? &lt;BR /&gt;&lt;BR /&gt;----------------------------------- &lt;BR /&gt;import java.util.*;&lt;BR /&gt;&lt;BR /&gt;public class Test&lt;BR /&gt;{&lt;BR /&gt; public static void main(String[] args) {&lt;BR /&gt;  Date date = new Date();&lt;BR /&gt;  &lt;BR /&gt;  while(true) {&lt;BR /&gt;   date.setTime(System.currentTimeMillis());&lt;BR /&gt;   System.out.println(date);&lt;BR /&gt;   try { &lt;BR /&gt;    Thread.sleep(5000);&lt;BR /&gt;   } catch (Exception e) {&lt;BR /&gt;    System.err.println(e);&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Oct 2005 09:04:00 GMT</pubDate>
    <dc:creator>Antonio Cardoso_1</dc:creator>
    <dc:date>2005-10-24T09:04:00Z</dc:date>
    <item>
      <title>java currentTimeMillis() not OK when date changed while programm running.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656061#M100629</link>
      <description>It seems that a java program running on HP-UX 11iv1 (rp4440, b2600) doesn't see the correct time using currentTimeMillis() if the date command was used to update current time while the program is running. &lt;BR /&gt;&lt;BR /&gt;=&amp;gt; the main class hereafter gets the current time each 5 seconds and prints it to screen. &lt;BR /&gt;- On a XP PC, the date and time is correctly updated after I change it on the desktop while the program is running. &lt;BR /&gt;- On a HP-UX system, the date/time update is not seen !!&lt;BR /&gt;&lt;BR /&gt;This looks like a bug ? &lt;BR /&gt;&lt;BR /&gt;----------------------------------- &lt;BR /&gt;import java.util.*;&lt;BR /&gt;&lt;BR /&gt;public class Test&lt;BR /&gt;{&lt;BR /&gt; public static void main(String[] args) {&lt;BR /&gt;  Date date = new Date();&lt;BR /&gt;  &lt;BR /&gt;  while(true) {&lt;BR /&gt;   date.setTime(System.currentTimeMillis());&lt;BR /&gt;   System.out.println(date);&lt;BR /&gt;   try { &lt;BR /&gt;    Thread.sleep(5000);&lt;BR /&gt;   } catch (Exception e) {&lt;BR /&gt;    System.err.println(e);&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 09:04:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656061#M100629</guid>
      <dc:creator>Antonio Cardoso_1</dc:creator>
      <dc:date>2005-10-24T09:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: java currentTimeMillis() not OK when date changed while programm running.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656062#M100630</link>
      <description>Here is my output from 11.11&lt;BR /&gt;&lt;BR /&gt;# /opt/java1.4/bin/java Test&lt;BR /&gt;Mon Oct 24 10:09:12 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:17 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:22 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:27 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:32 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:37 EDT 2005&lt;BR /&gt;Mon Oct 24 10:09:42 EDT 2005&lt;BR /&gt;&lt;BR /&gt;What version of java you are running ? &lt;BR /&gt;Also check# date &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Mon, 24 Oct 2005 09:10:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656062#M100630</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-10-24T09:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: java currentTimeMillis() not OK when date changed while programm running.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656063#M100631</link>
      <description>I'm using Java 1.4.2-04. &lt;BR /&gt;&lt;BR /&gt;I've got a similar output: &lt;BR /&gt;$ java Test  &lt;BR /&gt;Mon Oct 24 16:41:26 CEST 2005&lt;BR /&gt;Mon Oct 24 16:41:31 CEST 2005&lt;BR /&gt;Mon Oct 24 16:41:36 CEST 2005&lt;BR /&gt;Mon Oct 24 16:41:41 CEST 2005&lt;BR /&gt;&lt;BR /&gt;The problem is when date is changed in the system while this program runs, it is not seen in the program, unless I quit and re-run it, for example, I entered the command :&lt;BR /&gt;   date -u 10241640 &lt;BR /&gt;while it was running for display above (between 16:41:31 and 16:41:36), and we can see that the program continues updating 5 and 5 seconds from the initial time. We only get the correct time after stopping/restarting the programm. &lt;BR /&gt;&lt;BR /&gt;On a XP system, I get a correct "live" update of system time in the running programm: &lt;BR /&gt;C:\Documents and Settings\Administrator&amp;gt;java Test&lt;BR /&gt;Mon Oct 24 16:47:18 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:47:23 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:47:28 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:47:33 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:46:36 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:46:41 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:46:46 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:47:54 GMT+07:00 2005&lt;BR /&gt;Mon Oct 24 16:47:59 GMT+07:00 2005&lt;BR /&gt;&lt;BR /&gt;(date aketered twice at 16:47:35 1mn back and&lt;BR /&gt;after 16:46:46 a bit more than 1mn forth).&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 09:54:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656063#M100631</guid>
      <dc:creator>Antonio Cardoso_1</dc:creator>
      <dc:date>2005-10-24T09:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: java currentTimeMillis() not OK when date changed while programm running.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656064#M100632</link>
      <description>Just though I'd update this as I spent ages searching for a solution to this problem and there's no resolution in this thread...&lt;BR /&gt;&lt;BR /&gt;Basically, it's a deliberate HP ploy done for performance reasons:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hp.com/products1/unix/java/java2/sdkrte14/infolibrary/sdk_rnotes_1.4.2.03.html#date_time" target="_blank"&gt;http://www.hp.com/products1/unix/java/java2/sdkrte14/infolibrary/sdk_rnotes_1.4.2.03.html#date_time&lt;/A&gt;</description>
      <pubDate>Fri, 04 Aug 2006 05:58:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/java-currenttimemillis-not-ok-when-date-changed-while-programm/m-p/3656064#M100632</guid>
      <dc:creator>Paul J Harris</dc:creator>
      <dc:date>2006-08-04T05:58:35Z</dc:date>
    </item>
  </channel>
</rss>

