Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 28

38.103.x.x news
125.34.x.x news
75.119.x.x download
83.222.x.x comment
65.55.x.x forum
89.149.x.x guestbook
83.233.x.x signup
194.0.x.x forum
65.55.x.x forum
65.55.x.x comment
66.249.x.x forum
208.69.x.x news
61.116.x.x ecaptcha
213.136.x.x comment
65.55.x.x forum
72.30.x.x forum
65.55.x.x forum
66.249.x.x comment
122.173.x.x ecaptcha
61.116.x.x ecaptcha
66.249.x.x forum
88.198.x.x ecaptcha
72.46.x.x ecaptcha
38.99.x.x user
218.58.x.x ecaptcha
72.46.x.x ecaptcha
65.55.x.x guestbook
24.45.x.x ecaptcha

Last Seen

ebyte Mon 19:44
Mr-Corpse Mon 18:26
ASIDONNY Mon 17:35
mindeekv Mon 16:57
Rich Mon 16:50

Newest Members

ASIDONNY Mon 17:35
schnups Mon 12:20
Russell1992 Mon 12:04
Chik3n44 Sun 17:32
horus39 Sun 11:50
PHP - Notes on Time / Time Zones / Date
Just a few notes for any PHP coders, that I dont think PHP.net makes clear enough.

time() is always GMT, seconds from 1970 GMT to the current time GMT, not to the local server time.
This can also be shown with: time() == date("U") == gmdate("U")

Its the date() function that makes GMT seconds into local server time, hence the need for gmdate().

Then you have strtotime() which returns seconds like time() but changes depending on the servers time zone.

$time = strtotime("2009-04-04"); echo gmdate("Y-m-d H:i:s", $time); outputs 2009-04-03 23:00:00
Why the loss of an hour ? Because it was run on a server with Day Light Savings that apply in April.
Instead you have to be more specific and use strtotime("2009-04-04 GMT")

However that wont help when doing certain date calculations:

$time = strtotime("1993-04-04 GMT");
echo gmdate("Y-m-d H:i:s", $time); outputs 1993-04-04 00:00:00
echo strtotime("+1 day GMT", $time); outputs 1993-04-04 23:00:00

Here you can instead add the seconds in a day ( $time += 60 * 60 * 24 ) but thats not suitable for adding months.

From PHP 5.1.0 there is the option date_default_timezone_set() however PHP4 is still widely used.

Oh and Happy New Year

Posted by Rich on Thursday 01 January 2009 - 13:14:01 | Read/Post Comment: 0
LGSL 5.0 Released
Here are the changes:

- Added: Call of Duty: World at War support
- Added: Jediknight: Jedi Academy support
- Added: Kingpin: Life of Crime support
- Added: Open Transport Tycoon Deluxe support
- Added: Star Wars: Battlefront support
- Added: Star Wars: Battlefront 2 support
- Added: Teeworlds support

- Updated: Half-Life and Source support
- Updated: Fuel of War to show player information
- Updated: UT3 to show player information

The map images are now in a seperate 5mb download, so LGSL is less than 150kb to download.

This will solve problems when uploading using a CMS plugin manager, makes upgrading easier,
and allows me to update the map images seperately from LGSL. I hope you like this change.

I would like to mention OC Remix who released the "Super Street Fighter II Turbo HD Remix"
soundtrack for free HERE which I downloaded mostly out of curiosity, but turned out to be great
coding music ( no lyrics with a good beat for concentration ) which sped up the release.

Upgrade information in the comments.

Posted by Rich on Wednesday 03 December 2008 - 13:51:43 | Read/Post Comment: 22
Where the hell is Richard
I have been avoiding the forums recently, my thanks goes to those who have been helping others.

I code for fun, but recently, for various reasons, its been the last thing I have wanted to do.

My time at the moment is being spent playing Left4Dead and Zombie Panic Source

Posted by Rich on Saturday 05 July 2008 - 05:03:06 | Read/Post Comment: 27
Go to page       >>  

Link Buttons
GREYCUBE BUTTON

GREYCUBE BUTTON
Donate
Because I can always hope...
Game Server
simplywebhost.com
mp_downfall
PLAYERS: 0 / 24

Mini Buttons

© GreyCube.com - Richard Perry - Powered by e107.org