[buddypress-trac] [BuddyPress Trac] #5781: strtotime() is evil don't use it

buddypress-trac noreply at wordpress.org
Sat Sep 3 17:49:54 UTC 2016


#5781: strtotime() is evil don't use it
--------------------------+-----------------------
 Reporter:  r-a-y         |       Owner:  r-a-y
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  2.7
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------

Comment (by jdgrimes):

 Replying to [comment:19 r-a-y]:
 > '''Update''' - Missed this part:
 >
 > > Today however, WordPress always sets the default timezone to UTC, so
 date(), time(), and strtotime() will return UTC times by default. This is
 reflected in newer code.
 >
 > You're technically correct, but other plugins could, in theory, modify
 the timezone.  Patch could still be applied to babyproof our timezone
 calls.

 That's true, but note that if a plugin changed this it would also affect
 `current_time()` since it
 [https://core.trac.wordpress.org/browser/tags/4.6/src/wp-
 includes/functions.php#L65 assumes] that `date()` and `time()` will always
 be UTC. (And probably many other places in core do this as well.)

 So it's fine to baby-proof it, but its worth noting that nothing is going
 to break it without breaking WordPress core. :-)

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5781#comment:20>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list