I am trying to convert this time format - 1480550400000+0000
in Y/m/d
date format using php date('Y/m/d',1480550400000+0000)
; but its not working. How can I make it work?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Solved I just divided this with 1000. $date = date("Y-m-d", $timestamp/1000); and it worked
Thanks
@Symplifys try this:
Remember to put timestamp in double quotes.
Try this code at http://phpfiddle.org/
You timestamp has microseconds, so first remove it.
output: Check the live demo.
Please note that the second parameter should be time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). Looks like you have entered milliseconds instead.
PHP date()
Try this: