Reputation: 797
Current server time is
[me@unknown ~]# date
Fri Feb 24 14:53:41 MYT 2012
When I echo date('Y-m-d H:i:s')
the date time is 2012-02-24 06:53:46
. The hour, minute & second is not same.
How do I get same date with server time in PHP?
Upvotes: 1
Views: 3119
Reputation: 16115
Set the timezone for MYT
before getting the date, e.g.:
date_default_timezone_set('Asia/Kuala_Lumpur');
Also see this example.
Upvotes: 1