|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-10-25 22:15 UTC] seld@php.net
Description:
------------
strtotime() should not reset the time unless specified, "next monday" does reset the time to 00:00, while "next week" does not.
Test script:
---------------
var_dump(strtotime('next monday'));
var_dump(strtotime('next week'));
var_dump(date('Y-m-d H:i:s', strtotime('next monday')));
var_dump(date('Y-m-d H:i:s', strtotime('next week')));
Expected result:
----------------
int 1288641482
int 1288641482
string '2010-11-01 19:58:02' (length=19)
string '2010-11-01 19:58:02' (length=19)
Actual result:
--------------
int 1288569600
int 1288641482
string '2010-11-01 00:00:00' (length=19)
string '2010-11-01 19:58:02' (length=19)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 13:00:01 2025 UTC |
These also reset time: echo date('Y-m-d H:i:s', strtotime('+1 monday')) . "\n"; echo date('Y-m-d H:i:s', strtotime('first monday')) . "\n"; echo date('Y-m-d H:i:s', strtotime('first monday of March 2011'));