mktime(0, 0, 0, 4, 5, 2007); returns 1175731200
but
SELECT UNIX_TIMESTAMP( "2007-04-05" ) returns 1175711400
How come there a difference of 19800 (5.5 hrs) ?
mktime != UNIX_TIMESTAMP
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Ok - this has to be something related to GMT as Indian time is exactly 5.5 hrs ahead of GMT.
my php.ini
Nothing related to date in my m.ini file
my php.ini
Code: Select all
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
;date.default_latitude = 31.7667
;date.default_longitude = 35.2333
;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Which time is correct? If it is MySQL, then uncomment the php.ini default.timezone setting then add = "{TIMEZONE}" to it where TIMEZONE is one of the timezones listed here.