public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Resetting time via time server doesn't affect cygwin 'date'
@ 2011-03-30 16:46 Henry S. Thompson
  2011-03-30 17:26 ` Thorsten Kampe
  0 siblings, 1 reply; 5+ messages in thread
From: Henry S. Thompson @ 2011-03-30 16:46 UTC (permalink / raw)
  To: cygwin

I'm running 1.7.9-1 on my 64-bit Windows 7 laptop.  I recently noticed
that my box was 15 seconds adrift from my Linux desktop.  After some
minor hassles, I was able to use Clock/Date and Time/Internet
Time/Change Settings/Update now to sync with a local ntp server, the
same one my desktop is using.  At this point the Windows clock on the
laptop and my desktop were in sync, but 'date' from a bash window was
_still_ 15 seconds out.

Is this a pervasive problem (to test this yourself, just use the
Windows UI to set your clock forward a minute, test the 'date' (it
should be as per Windows clock), then use the above path to resync
with a time server, and observe that 'date' is _not_ adjusted back),
or particular to Windows 7/Cygwin 1.7.9?

I found vsntp [1] which fixed the problem, but is as far as I can see
overkill as it's designed to fix a much more serious problem . . .

ht

[1] http://www.imacat.idv.tw/tech/vsntp.html
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Resetting time via time server doesn't affect cygwin 'date'
  2011-03-30 16:46 Resetting time via time server doesn't affect cygwin 'date' Henry S. Thompson
@ 2011-03-30 17:26 ` Thorsten Kampe
  2011-03-30 17:41   ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Kampe @ 2011-03-30 17:26 UTC (permalink / raw)
  To: cygwin

* Henry S. Thompson (Wed, 30 Mar 2011 14:10:37 +0100)
> I'm running 1.7.9-1 on my 64-bit Windows 7 laptop. I recently noticed
> that my box was 15 seconds adrift from my Linux desktop. After some
> minor hassles, I was able to use Clock/Date and Time/Internet
> Time/Change Settings/Update now to sync with a local ntp server, the
> same one my desktop is using. At this point the Windows clock on the
> laptop and my desktop were in sync, but 'date' from a bash window was
> _still_ 15 seconds out.
> 
> Is this a pervasive problem (to test this yourself, just use the
> Windows UI to set your clock forward a minute, test the 'date' (it
> should be as per Windows clock), then use the above path to resync
> with a time server, and observe that 'date' is _not_ adjusted back),
> or particular to Windows 7/Cygwin 1.7.9?

I just tested it: I set the time manually back five minutes via the the 
control panel > Date and Time. The time change was reflected in a Cmd 
window ("time /t") while a "date" in bash still showed the "old" time (+
5min). Where does the bash date gets the time from?!

Thorsten


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Resetting time via time server doesn't affect cygwin 'date'
  2011-03-30 17:26 ` Thorsten Kampe
@ 2011-03-30 17:41   ` Corinna Vinschen
  2011-03-30 19:47     ` Henry S. Thompson
  2011-03-30 20:16     ` Henry S. Thompson
  0 siblings, 2 replies; 5+ messages in thread
From: Corinna Vinschen @ 2011-03-30 17:41 UTC (permalink / raw)
  To: cygwin

On Mar 30 18:16, Thorsten Kampe wrote:
> * Henry S. Thompson (Wed, 30 Mar 2011 14:10:37 +0100)
> > I'm running 1.7.9-1 on my 64-bit Windows 7 laptop. I recently noticed
> > that my box was 15 seconds adrift from my Linux desktop. After some
> > minor hassles, I was able to use Clock/Date and Time/Internet
> > Time/Change Settings/Update now to sync with a local ntp server, the
> > same one my desktop is using. At this point the Windows clock on the
> > laptop and my desktop were in sync, but 'date' from a bash window was
> > _still_ 15 seconds out.
> > 
> > Is this a pervasive problem (to test this yourself, just use the
> > Windows UI to set your clock forward a minute, test the 'date' (it
> > should be as per Windows clock), then use the above path to resync
> > with a time server, and observe that 'date' is _not_ adjusted back),
> > or particular to Windows 7/Cygwin 1.7.9?
> 
> I just tested it: I set the time manually back five minutes via the the 
> control panel > Date and Time. The time change was reflected in a Cmd 
> window ("time /t") while a "date" in bash still showed the "old" time (+
> 5min). Where does the bash date gets the time from?!

There's an internal counter which is initialized by the first Cygwin
process started in a session.  So time chanegs made by a Cygwin process
are seen by other Cygwin processes in the same session, but time changes
outside of Cygwin or outside of the same session are not seen, unless all
Cygwin processes in a session are stopped and restarted.  This will be
fixed at one point.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Resetting time via time server doesn't affect cygwin 'date'
  2011-03-30 17:41   ` Corinna Vinschen
@ 2011-03-30 19:47     ` Henry S. Thompson
  2011-03-30 20:16     ` Henry S. Thompson
  1 sibling, 0 replies; 5+ messages in thread
From: Henry S. Thompson @ 2011-03-30 19:47 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen writes:

> There's an internal counter which is initialized by the first Cygwin
> process started in a session.  So time chanegs made by a Cygwin process
> are seen by other Cygwin processes in the same session, but time changes
> outside of Cygwin or outside of the same session are not seen, unless all
> Cygwin processes in a session are stopped and restarted.  This will be
> fixed at one point.

Thanks for clarifying.

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Resetting time via time server doesn't affect cygwin 'date'
  2011-03-30 17:41   ` Corinna Vinschen
  2011-03-30 19:47     ` Henry S. Thompson
@ 2011-03-30 20:16     ` Henry S. Thompson
  1 sibling, 0 replies; 5+ messages in thread
From: Henry S. Thompson @ 2011-03-30 20:16 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen writes:

> There's an internal counter which is initialized by the first Cygwin
> process started in a session.  So time chanegs made by a Cygwin process
> are seen by other Cygwin processes in the same session, but time changes
> outside of Cygwin or outside of the same session are not seen, unless all
> Cygwin processes in a session are stopped and restarted.  This will be
> fixed at one point.

So running something like this

   date -s `cmd /c echo %time%`

either _ad lib_ or as a cron job every few days will limit the damage,
at the cost of losing a bit across the board each time you do it,
since the situation is _not_ symmetrical.  That is, because date -s in
Cygwin _does_ reset the windows clock. . .

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-30 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 16:46 Resetting time via time server doesn't affect cygwin 'date' Henry S. Thompson
2011-03-30 17:26 ` Thorsten Kampe
2011-03-30 17:41   ` Corinna Vinschen
2011-03-30 19:47     ` Henry S. Thompson
2011-03-30 20:16     ` Henry S. Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).