<?php
$thisWeek = new DateTime('@1408706174'); // get the day of the week, Monday = 0, Sunday = 6
$dayOfWeek = ((int)$thisWeek->format('N'))-1;
$thisWeek->setTime(0,1,0);
// subtract the day of the week to get Monday of this week
$thisWeek->modify("-0 days");
// get the timestamp
$monday = $thisWeek->format('U');
var_dump($monday);
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
string(10) "1408665660"
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/XofgP on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/XofgP on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/XofgP on line 2