| View previous topic :: View next topic |
| Author |
Message |
Slaktarn Halfop
Joined: 02 May 2007 Posts: 44
|
Posted: Sun Sep 04, 2011 3:12 am Post subject: Wrong time |
|
|
Hello all ppl i don´t get it, my eggdrop shows wrong time!
| Quote: | I have
[clock format [clock seconds] -format {%a %b %d %H:%M:%S %Y %Z}]
Sun Sep 04 08:59:54 2011 +0200
Correct shuld be
Sun Sep 04 08:59:40 2011 +0200
|
| Code: | The unixtime is correct
1315119580 |
| Quote: | And my settigs in the eggdrop is
set timezone "CET"
set offset "-1"
#set env(TZ) "$timezone $offset" |
Thx for the help Slaktarn
A little notice i don´t know if the timezone is correct i live in sweden, but what i read in the doc it shuld be the right one from what i understand |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Sep 04, 2011 10:23 am Post subject: |
|
|
You are talking about a 14 second discrepancy; are you sure that the systems you are comparing aren't simply out of sync? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Slaktarn Halfop
Joined: 02 May 2007 Posts: 44
|
Posted: Sun Sep 04, 2011 1:48 pm Post subject: |
|
|
| nml375 wrote: | | You are talking about a 14 second discrepancy; are you sure that the systems you are comparing aren't simply out of sync? |
Yeh im sure as i say my unixtime is correct, and it checks the minutes to internet every 1min so its correct |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Sep 04, 2011 4:01 pm Post subject: |
|
|
Then you've got the very first case I've ever seen where "clock format" calculates the value incorrectly.
Just for fun, though; Could you post the output of this:
| Code: | | clock format 1315119600 |
That should yield something like "sön sep 04 09.00.00 CEST 2011". If it does, that means clock format works just fine, and your clocks are off.
If we'd been talking of an hour (to the hour) difference, it'd be a timezone setting, but you won't get a 14 second diff. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Slaktarn Halfop
Joined: 02 May 2007 Posts: 44
|
Posted: Mon Sep 05, 2011 2:23 pm Post subject: |
|
|
As you can see the unixtime is correct and your test are correct, but of some reason the clock format shows totaly wrong time and now is the diff almost a minute
| Code: | PRIVMSG $channel :\002\[\002\00304TiME:\003 [clock format [clock seconds] -format {%a %b %d %H:%M:%S %Y %Z}]\002\]\002 \002\[\002\00304UNiXTiME:\003 [unixtime]\002\]\002
[2011-09-05] [20:17:55] »» [BOT] [TiME: Mon Sep 05 20:18:57 2011 +0200] [UNiXTiME: 1315246675] |
| Code: | PRIVMSG $channel :\002\[\002\00304TiME Test:\003 [clock format 1315119600]\002\]\002 \002\[\002\00304UNiXTiME:\003 [unixtime]\002\]\002
[2011-09-05] [20:17:55] »» [BOT] [TiME Test: Sun Sep 04 09:00:00 +0200 2011] [UNiXTiME: 1315246675] |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Sep 05, 2011 4:22 pm Post subject: |
|
|
clock format does show the correct formatting for the given timestamp(s). I do notice that you are mixing unixtime and clock seconds as the source for the "unixtime", which would suggest that these are returning different values at any specific point in time.
The unixtime command relies on the time(2) system call, while clock seconds uses the gettimeofday(2) system call. Both of these should return the value of the system clock, thus I have no further ideas of the issue right now. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|