This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Wrong time

General support and discussion of Eggdrop bots.
Post Reply
S
Slaktarn
Halfop
Posts: 44
Joined: Wed May 02, 2007 1:48 am

Wrong time

Post by Slaktarn »

Hello all ppl i don´t get it, my eggdrop shows wrong time!
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: Select all

The unixtime is correct 

1315119580
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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
S
Slaktarn
Halfop
Posts: 44
Joined: Wed May 02, 2007 1:48 am

Post by Slaktarn »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

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
S
Slaktarn
Halfop
Posts: 44
Joined: Wed May 02, 2007 1:48 am

Post by Slaktarn »

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: Select all

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: Select all

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]
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply