[Pharo-project] Synchronizing system time
Hello, I try to implement system time synchronization with some server. And I found that when system OS time changed running pharo instance don't see that. I execute DateAndTime>>initializeOffsets but it not helps. Is it bug somewhere? Is it possible to reinitialize OS date and time from running pharo? I use WindowsXP Best regards, Denis
On 2012-07-13, at 08:45, Denis Kudriashov wrote:
Hello,
I try to implement system time synchronization with some server. And I found that when system OS time changed running pharo instance don't see that. I execute DateAndTime>>initializeOffsets but it not helps.
Is it bug somewhere? Is it possible to reinitialize OS date and time from running pharo?
Instances of DateAndTime directly store the seconds / nanoseconds for they time. If the underlying system time changes this is not reflected in the existing instances... If you can get somehow the offset by which the time changed you can manually loop over all DateAndTime objects and replace the internal representations... DateAndTime allInstances do: [ :each| each instVarNamed: #seconds put: each seconds + systemTimeChange ].
I use WindowsXP
Best regards, Denis
I think, you dont understand me. Getting current date and time not reflects system time changes. Just start pharo then change your windows system time and execute "DateAndTime now". It will return wrong datetime. So question: how to reinitialize DateAndTime in such situation to get right system date and time? 2012/7/13 Camillo Bruni <camillobruni@gmail.com>
On 2012-07-13, at 08:45, Denis Kudriashov wrote:
Hello,
I try to implement system time synchronization with some server. And I found that when system OS time changed running pharo instance don't see that. I execute DateAndTime>>initializeOffsets but it not helps.
Is it bug somewhere? Is it possible to reinitialize OS date and time from running pharo?
Instances of DateAndTime directly store the seconds / nanoseconds for they time. If the underlying system time changes this is not reflected in the existing instances...
If you can get somehow the offset by which the time changed you can manually loop over all DateAndTime objects and replace the internal representations...
DateAndTime allInstances do: [ :each| each instVarNamed: #seconds put: each seconds + systemTimeChange ].
I use WindowsXP
Best regards, Denis
On 2012-07-14, at 11:37, Denis Kudriashov wrote:
I think, you dont understand me.
Getting current date and time not reflects system time changes. Just start pharo then change your windows system time and execute "DateAndTime now". It will return wrong datetime.
ah, ok, then that is clearly broken! yay Yet another substantial DateAndTime bug
So question: how to reinitialize DateAndTime in such situation to get right system date and time?
most probably :) can you open a bug report with a reproducible description?
2012/7/14 Camillo Bruni <camillobruni@gmail.com>
On 2012-07-14, at 11:37, Denis Kudriashov wrote:
I think, you dont understand me.
Getting current date and time not reflects system time changes. Just start pharo then change your windows system time and execute "DateAndTime now". It will return wrong datetime.
ah, ok, then that is clearly broken! yay Yet another substantial DateAndTime bug
So question: how to reinitialize DateAndTime in such situation to get right system date and time?
most probably :)
can you open a bug report with a reproducible description?
participants (2)
-
Camillo Bruni -
Denis Kudriashov