amir-f
amir-f

Reputation: 731

PHP date function for formatting time

I am using the date function to get formatted time for timestamps between 0 and 86400. Therefore I expect to get 12:00am for timestamp 0, but instead I get 1:00am. Can anyone tell me why this is happening?

Upvotes: 0

Views: 49

Answers (2)

Jeroen
Jeroen

Reputation: 2093

Try changing the timezone your PHP date() function uses. It's probably +1:00 now.

Upvotes: 1

dev-null-dweller
dev-null-dweller

Reputation: 29462

It's because of your timezone setting, use gmdate instead

Upvotes: 1

Related Questions