davidlee
davidlee

Reputation: 6167

problem with mktime and timezone

I would like to display the time stamp of 00:00:00 1 Nov 2010 with the code as below

$day = mktime(0,0,0,11,1,2010);

However, it always display the wrong timestamp from what I intended. For example,

date('h m s d m y', $day);

will return '12 11 00 01 11 10'

It always behind 12hr and 11min. May I know what went wrong? How to rectify? Thanks..

Upvotes: 0

Views: 1033

Answers (2)

PeeHaa
PeeHaa

Reputation: 72682

print(date('H i s d m y', mktime(0,0,0,11,1,2010))); is what you want I guess

Upvotes: 0

Jarod Elliott
Jarod Elliott

Reputation: 15670

You are using the wrong date format string. Check out the man page for the correct format string options.

For your example you probably want date('H i s d m y',$day)

Upvotes: 5

Related Questions