Peter verleg Peter verleg - 1 year ago 76
PHP Question

converting UNIX time stamp date to the Monday of that week

how can i convert a time stamp to Monday corresponding with that week?

1473750000 (Tue, 13 Sep 2016 07:00:00 GMT)

// coding magic

1473638400 (Mon, 12 Sep 2016 00:00:00 GMT )

Answer Source

To convert timestamps, you can use a PHP Function gmdate(). I already use this on some of my projects/sites.

$timestamp = strtotime("+1 hour"); //Uk Time
echo gmdate("H:i", $timestamp); //Hour:Minutes

For the other parts of gmdate(), check the PHP Manual.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download