Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove time part of a timestamp

How can I remove time part of a timestamp?

So for example turn 1310571061 to 1310565600 which is the plain date timestamp.

like image 933
David Weng Avatar asked Jul 13 '11 15:07

David Weng


People also ask

How do I remove seconds from timestamp in Excel?

In the "Format Cells" dialog box, on the "Number" tab, select the category "Custom," and choose the type "h:mm" or "h:mm:ss" depending on whether seconds need to appear. 6. Select "Ok."

How do you get rid of time in a date field?

Remove Time from Date Using Find and Replace Select all the timestamps from which you want the time removed. Go to Home tab > Find & Select button > Replace… option or press Ctrl + H to open the Find and Replace dialog box. In the Find what field, type a space character and an asterisk "*".


1 Answers

strtotime(date("Y-m-d", 1310571061));

That should do it for you.

like image 199
Brad Avatar answered Oct 13 '22 15:10

Brad