[MODDB] Automatic Daylight Savings Time (DST) 2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.2

Post by Muad''Dib » Sat Mar 14, 2009 3:35 pm

No, thank you for taking the time to do something like this. It has been needed pretty bad in my opinion.
Last edited by Muad''Dib on Sun Mar 15, 2009 5:08 pm, edited 1 time in total.

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.2

Post by MartectX » Sat Mar 14, 2009 4:32 pm

With the next version I want to introduce a true conversion of the current time zones to the new ones. For this I came up with the following table. I tried to find the most prominent substitutes for each zone. Please have a look through it and make suggestions:

Code: Select all

/**
* Time Zone Conversion Table
*/

'-12'	=> '',						// [UTC - 12] Baker Island Time
'-11'	=> 'Pacific/Samoa',			// [UTC - 11] Niue Time, Samoa Standard Time
'-10'	=> 'Pacific/Tahiti',		// [UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time
'-9.5'	=> '',						// [UTC - 9:30] Marquesas Islands Time
'-9'	=> 'America/Anchorage',		// [UTC - 9] Alaska Standard Time, Gambier Island Time
'-8'	=> 'America/Los_Angeles',	// [UTC - 8] Pacific Standard Time
'-7'	=> 'America/Phoenix',		// [UTC - 7] Mountain Standard Time
'-6'	=> 'America/Detroit',		// [UTC - 6] Central Standard Time
'-5'	=> 'America/Chicago',		// [UTC - 5] Eastern Standard Time
'-4.5'	=> '',						// [UTC - 4:30] Venezuelan Standard Time
'-4'	=> 'America/Grenada',		// [UTC - 4] Atlantic Standard Time
'-3.5'	=> '',						// [UTC - 3:30] Newfoundland Standard Time
'-3'	=> 'America/Sao_Paulo',		// [UTC - 3] Amazon Standard Time, Central Greenland Time
'-2'	=> 'America/Scoresbysund',	// [UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time
'-1'	=> 'Atlantic/Cape_Verde',	// [UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time
'0'		=> 'Europe/London',			// [UTC] Western European Time, Greenwich Mean Time
'1'		=> 'Europe/Berlin',			// [UTC + 1] Central European Time, West African Time
'2'		=> 'Europe/Kiev',			// [UTC + 2] Eastern European Time, Central African Time
'3'		=> 'Europe/Moscow',			// [UTC + 3] Moscow Standard Time, Eastern African Time
'3.5'	=> 'Asia/Tehran',			// [UTC + 3:30] Iran Standard Time
'4'		=> 'Asia/Dubai',			// [UTC + 4] Gulf Standard Time, Samara Standard Time
'4.5'	=> 'Asia/Kabul',			// [UTC + 4:30] Afghanistan Time
'5'		=> 'Asia/Karachi',			// [UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time
'5.5'	=> 'Asia/Calcutta',			// [UTC + 5:30] Indian Standard Time, Sri Lanka Time
'5.75'	=> 'Asia/Katmandu',			// [UTC + 5:45] Nepal Time
'6'		=> 'Asia/Novosibirsk',		// [UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time
'6.5'	=> 'Asia/Rangoon',			// [UTC + 6:30] Cocos Islands Time, Myanmar Time
'7'		=> 'Asia/Bangkok',			// [UTC + 7] Indochina Time, Krasnoyarsk Standard Time
'8'		=> 'Asia/Shanghai',			// [UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time
'8.75'	=> '',						// [UTC + 8:45] Southeastern Western Australia Standard Time
'9'		=> 'Asia/Tokyo',			// [UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time
'9.5'	=> '',						// [UTC + 9:30] Australian Central Standard Time
'10'	=> 'Asia/Vladivostok',		// [UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time
'10.5'	=> 'Australia/Lord_Howe',	// [UTC + 10:30] Lord Howe Standard Time
'11'	=> 'Pacific/Guadalcanal',	// [UTC + 11] Solomon Island Time, Magadan Standard Time
'11.5'	=> 'Pacific/Norfolk',		// [UTC + 11:30] Norfolk Island Time
'12'	=> 'Pacific/Auckland',		// [UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time
'12.75'	=> 'Pacific/Chatham',		// [UTC + 12:45] Chatham Islands Time
'13'	=> 'Pacific/Tongatapu',		// [UTC + 13] Tonga Time, Phoenix Islands Time
'14'	=> 'Pacific/Kiritimati',	// [UTC + 14] Line Island Time

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.2

Post by Muad''Dib » Sat Mar 14, 2009 9:27 pm

Looks like you covered most from -12 to +14 ... i dont see right off the bat what others would be needed.

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by MartectX » Sun Mar 15, 2009 11:51 am

Version 1.1.3
  • Improved compatibility with other modifications
  • Time zone conversion utility
  • Support for African and Australian time zones

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by Muad''Dib » Sun Mar 15, 2009 8:29 pm

Good news is it all works as expected.

The bad news is that i am still personally unhappy with the text that it uses to show the timezones.

So i stated changing some things around. I set my own timezone to -8.00 (within phpmyadmin), and changed the definition in "convert_timezones.php" to what i wanted it to say"
"[UTC - 8] Pacific Standard Time". This showed what i wanted it to on the board, but of course all that does is basically change what is in the database for my user account.. and that is what is printed on the board itself. It doesnt change the actual drop down lists in UCP or ACP..

what i was thinking was, why cant the print in the drop down boxes use the $timetable array that is similar to what is in convert_timezones.php?

I guess this is so important to me because one thing im concearned about is most people know what time zone they are in if its in [UTC -2] format. However, some i can easily see get confused as to what city is in the same timezone as them. It may or may not truly be the case, however it makes since in my mind! :D

I know i dont know enough about php or sql databases... but i would assume that is all done in the function automatic_dst_get_time_zones()....
Last edited by Muad''Dib on Sun Mar 15, 2009 11:14 pm, edited 1 time in total.

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by MartectX » Sun Mar 15, 2009 9:20 pm

Muad''Dib wrote:So i stated changing some things around. I set my own timezone to -8.00 (within phpmyadmin), and changed the definition in "convert_timezones.php" to what i wanted it to say
"[UTC - 8] Pacific Standard Time". This showed what i wanted it to on the board, but of course all that does is basically change what is in the database for my user account.. and that is what is printed on the board itself. It doesnt change the actual drop down lists in UCP or ACP..

what i was thinking was, why cant the print in the drop down boxes use the $timetable array that is similar to what is in convert_timezones.php?
We could of course make a simple find/replace array that converts some cities to the old phpBB3 name. We could also scratch all cities but some two dozen and have just those options (with replaced names as you suggest). But that is just not what this MOD is about. This MOD is about Automatic Daylight Savings Time and thanks to non-unanimous geopolitics you just cannot determine DST from the "UTC + X" time zone! For example in UTC-7 alone there are US states which sport DST (Colorado) and some which do not (Arizona). In the city-based system the user may choose America/Denver and America/Phoenix respectively and be done with it. If I'd opt for the UTC dropdown box I'd have to re-introduce the UCP option of "Enable DST: YES / NO" which to eliminate was this MOD's whole point.

Sorry, it just won't work the old way.
Muad''Dib wrote:I guess this is so important to me because one think im concearned about is most people know what time zone they are in if its in [UTC -2] format. However, some i can easily see get confused as to what city is in the same timezone as them. It may or may not truly be the case, however it makes since in my mind! :D
If you want to make sure people find their time zone - and the more I think about it the more I have to agree - we'll give them the full list of available ones. Do it this way for now (next version will default to this):

OPEN includes/automatic_dst.php

FIND AND DELETE

Code: Select all

	$cities = array_unique($cities);

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by Muad''Dib » Sun Mar 15, 2009 11:17 pm

Its still slightly confusing to me .. but i think i understand where your coming from. Time is such a pos isnt it? ;)

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by MartectX » Mon Mar 16, 2009 9:19 am

Version 1.1.4
  • Some spelling mistakes
  • Optimization of the time zone conversion utility
  • Support for all available city-based time zones
Muad''Dib wrote:Its still slightly confusing to me .. but i think i understand where your coming from. Time is such a pos isnt it? ;)
The UTC timezones itself bare no information about DST settings and that is why I must use the city-based time zones. Clear now?

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by Muad''Dib » Mon Mar 16, 2009 4:37 pm

MartectX wrote:Version 1.1.4
  • Some spelling mistakes
  • Optimization of the time zone conversion utility
  • Support for all available city-based time zones
Muad''Dib wrote:Its still slightly confusing to me .. but i think i understand where your coming from. Time is such a pos isnt it? ;)
The UTC timezones itself bare no information about DST settings and that is why I must use the city-based time zones. Clear now?
Yes thanks. I hope i havent completly made you frustrated with my newbish inquiries :D

As far as the update .. not sure when ill get to install.. but ill make a post afterwards.

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.3

Post by MartectX » Mon Mar 16, 2009 4:53 pm

Muad''Dib wrote:Yes thanks. I hope i havent completly made you frustrated with my newbish inquiries :D
Not at all. Actually I'm sure there will be lots of wondrous comments about the new time zone system once this upgrade is validated so I could as well now create some templates to copy & paste later. :mrgreen:

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.4

Post by Muad''Dib » Thu Mar 19, 2009 4:53 pm

Sorry for the delay, but the latest version works great. :D

papaFX
Registered User
Posts: 3
Joined: Thu Mar 19, 2009 9:53 pm

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.4

Post by papaFX » Thu Mar 19, 2009 9:58 pm

Used to have the old MOD, but due to server relocation I tried to use the beta one.
After following the install instruction I have the following error
"Fatal error: Call to undefined function: date_default_timezone_set() in /home/eastmedf/dev_forum/includes/automatic_dst.php on line 75
"

Any help would be appreciated.
My board is v3.0.4 and no other MODs installed, just a style...

8-)

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.4

Post by MartectX » Thu Mar 19, 2009 10:48 pm

papaFX wrote:Used to have the old MOD, but due to server relocation I tried to use the beta one.
After following the install instruction I have the following error
"Fatal error: Call to undefined function: date_default_timezone_set() in /home/eastmedf/dev_forum/includes/automatic_dst.php on line 75
"

Any help would be appreciated.
My board is v3.0.4 and no other MODs installed, just a style...

8-)
What version of PHP are you using?

papaFX
Registered User
Posts: 3
Joined: Thu Mar 19, 2009 9:53 pm

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.4

Post by papaFX » Thu Mar 19, 2009 10:53 pm

5.2.5
I temp solved the problem by moving the files to a directory under "public_html".
(initially the files where out of that dir for safety reasons)
Sorry but my php knowledge is minimum... :oops:

8-)

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Automatic Daylight Savings Time (DST) 1.1.4

Post by MartectX » Thu Mar 19, 2009 10:56 pm

papaFX wrote:5.2.5
I temp solved the problem by moving the files to a directory under "public_html".
(initially the files where out of that dir for safety reasons)
What is the "safety" difference between public_html and the other folder where it didn't work?

Locked

Return to “[3.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 19 guests