Store Date to UTC one-liner by PHP -
i understand best practice store dates utc databases quite confused in scenario in. let's have form end-user inserts date "07-15-2016" in eastern timezone. necessary store utc date or as-is since it's not datetime?
i'm using one-liner in php sanitize date format before insert database.
// user input 07-15-2016 , formatted 2016-07-15 00:00:00 $userdate = datetime::createfromformat('m-d-y', '07-15-2016')->format('y-m-d h:i:s'));
is there make sure nothing messes since user-input est; meanwhile, time 00:00:00?
Comments
Post a Comment