collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: The Time  (Read 9325 times)

0 Members and 4 Guests are viewing this topic.

Offline Duffy

  • BeBot Rookie
  • *
  • Posts: 1
  • Karma: +0/-0
The Time
« on: July 07, 2008, 11:20:03 pm »
Where does the bot get the time information for time output from ?
My bot tells me the wrong time (i guess GMT) but in germany we currently use gmt+2. Systemclock of the unix box is set correctly

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: The Time
« Reply #1 on: July 08, 2008, 10:42:14 am »
When you do !time it should tell ya AO time

Code: [Select]
Rsbot: It is currently 08:37:27 July 8, 29482 Rubi-Ka Universal Time.
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline grasfer

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: The Time
« Reply #2 on: July 08, 2008, 03:28:10 pm »
Anyway to change the time it display to local time and not GMT?

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: The Time
« Reply #3 on: July 09, 2008, 07:03:26 am »
No, which is pretty much intentional. :)

There is no decent way for php to figure out what your local timezone is (that I've found anyway.) Also, the bots logging and just about everything that deals with time is going by UTC time.

Offline grasfer

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: The Time
« Reply #4 on: July 09, 2008, 11:44:57 am »
No, which is pretty much intentional. :)

There is no decent way for php to figure out what your local timezone is (that I've found anyway.) Also, the bots logging and just about everything that deals with time is going by UTC time.

So i guess php can't even check the system clock or something?

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: The Time
« Reply #5 on: July 09, 2008, 12:11:43 pm »
No, which is pretty much intentional. :)

There is no decent way for php to figure out what your local timezone is (that I've found anyway.) Also, the bots logging and just about everything that deals with time is going by UTC time.

So i guess php can't even check the system clock or something?

Yes it can. "date" checks the local system time and takes in account of timezone settings on the server. But it may be that Bebot is setup to use UTC as timezone as thats what AO operates in.

Offline grasfer

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: The Time
« Reply #6 on: July 09, 2008, 01:24:41 pm »
Well, aint it possible to just remove AO code and just add a system clock check thingie? :P Or even add a system clock message to the !time message? :)

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: The Time
« Reply #7 on: July 09, 2008, 02:05:45 pm »
PHP can check the system clock on the server it is running on (not any game servers) but not on the client - this means that the bot is not aware of the time zone your guild mates are in (which may not be the same as your or the servers time zone).

It is possible to modify the bot so that your members can manually change their own time zone, but this would only work correctly if displayed in tells (the guild chat would need to be a single timezone) or to be able to set a time zone for the bot, but this would require significant changes throughout the bot and any module that displays the time.

Far better, imho, to consistently display the time in UTC and let your members work out the difference themselves.
« Last Edit: July 09, 2008, 02:42:50 pm by Vrykolas »

Offline grasfer

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: The Time
« Reply #8 on: July 09, 2008, 02:24:14 pm »
ahhh, so the bot actually check the time from the chat server it is connected to and not from where the bot is running?

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: The Time
« Reply #9 on: July 09, 2008, 02:42:19 pm »
no it checks the server it is running on - I used the wrong terminology there.

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
Re: The Time
« Reply #10 on: July 09, 2008, 02:51:25 pm »
The easiest would just be to make a module for worldtime. :)

So it shows the time in several timezones in a popup.

Offline grasfer

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: The Time
« Reply #11 on: July 09, 2008, 03:50:33 pm »
I'm sorry but i just can't see the logic here, if it check the time on server why can't it check the real time on the server and not gmt?

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: The Time
« Reply #12 on: July 09, 2008, 04:42:06 pm »
it could - all you have to do is go through all the bots files and change the occurences of the function call gmdate to date, and re-apply the changes every time you update to a new version of the bot or install a new mod

Offline Jovy

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: The Time
« Reply #13 on: July 09, 2008, 06:23:55 pm »
File: core/Time.php Line: 74

change:
$output = "It is currently ".gmdate("H:i:s F j,");

to:
$output = "It is currently ".date("H:i:s F j, Y");

gmdate() returns only GMT. date() uses the configured timezone

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: The Time
« Reply #14 on: July 09, 2008, 07:12:11 pm »
File: core/Time.php Line: 74

change:
$output = "It is currently ".gmdate("H:i:s F j,");

to:
$output = "It is currently ".date("H:i:s F j, Y");

that will only affect !time, and leave the timestamps on the last seen on alts, whois, the log, the afks the roster along with several other things unchanged and still using UTC

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 339
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal