horgen horgen - 1 year ago 97
PHP Question

How to get the day of the week from a Unix timestamp (PHP)?

How do I get the day (1-7) from a Unix timestamp in PHP? I also need the day date (1-31) and month (1-12).

Answer Source

You can use date() function

$weekday = date('N', $timestamp); // 1-7
$month = date('m', $timestamp); // 1-12
$day = date('d', $timestamp); // 1-31
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download