Take the 2-minute tour ×

We are creating a unix timestamp with the mktime method giving following attributes:

print_r(mktime(null,null,null,3,1,2009) / 60 / 60 / 24) . "days");`

this creates a result of


14303.958333333 days

this should be 14304 days. The problem in this case is the winter hour. You can use the is_dst parameter, and when we use 0 (default -1) this sometimes works correctly giving 14304 days as a result.

But sometimes this gives following problem:

Strict Standards: mktime() [function.mktime]:The is_dst parameter is deprecated

i have no idea what it means and what i can do about it. Any idea someone? because the winter hour is causing terrible head ache....

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Use gmmktime.

share|improve this answer
add comment
date("I", time());

Will give you 1 if its daylight savings and 0 if its not.

share|improve this answer
add comment

From the php manual page:

"Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT message if using the system settings or the TZ environment variable. See also date_default_timezone_set()"

that probably means you should use date_default_timezone_set() previously and skip the is_dst parameter

share|improve this answer
add comment

Your Answer


