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

buddypress-trac noreply at wordpress.org
Fri Aug 19 18:41:35 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 r-a-y):

 > Adding +0000 to the other strtotime calls also seems like it makes good
 sense.

 So WP core has a function - `mysql2date()` - that adds `+0000` to the date
 and uses `strtotime()` when used like this `mysql2date( 'G', 'SOME DATE
 STRING' )`;

 I've gone ahead replaced all calls to `strtotime()` with `mysql2date( 'G',
 X )` '''except''' xprofile date fields.  As mentioned in comment:1, I
 wasn't sure if xprofile date field data should be stored in GMT or not.

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


More information about the buddypress-trac mailing list