need the number of seconds since.... |
T = Time
Z = Zone So that parsers know where to start looking. U = Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) This is the same as time(), like you wanted. Personally I'm using UUIDv4 instead of auto incremented. And storing them as BINARY(16). But you can store them as strings too. PHP Code: <?php PHP Code: $date = new DateTime(); YOU NEED TO INSTALL CALENDAR TO USE THIS FUNCTION http://php.net/manual/en/book.calendar.php http://php.net/manual/en/datetime.settime.php http://php.net/manual/en/function.gregoriantojd.php This assumes that days are counted like this: 1, 2, 3, 4 ... NOT 01, 02, 03, 04 ... PHP Code: $gregorian = DateTime::createFromFormat("D M j Y","Thu Aug 16 2018"); |
Welcome Guest, Not a member yet? Register Sign In |