Jump to content

Daylight savings...


Recommended Posts

ok I know how to set default timezone...

But how to set the daylight saving???? So it automatically switches the times... And from given timestamp shows the correct time (even for lets say 7 months old timestamp)

Found some functions on web.. But none seem to work properly.. Any advice on this? Or is it even important to have a correct DST??

Never thought how complicated timekeeping is till got into this programming thing :) Remember once on discovery saw this guy that was a timekeeper for a living... Gee I thought wtf is timekeeper for.... Just buy a clock lol Well I take my words back now :D

Link to comment
Share on other sites

To change default time zone, you can either change the time zone in your WHM (thats if you own your own server), or you can use the following php function:

date_default_timezone_set ();

If you want, London time for example,

date_default_timezone_set ('Europe/London' );


About the daylight saving, you would have to do something like this:

$hour = date("h", time());

if ($v3 < 12) { echo "Its morning"; )

^^ That would tell you whether its morning/night ect. I havent tested it, so it may not work however thats the kind of script you would have to use.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...