note 113873 deleted from function.date by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:19:47 +0000 |
| Subject: | note 113873 deleted from function.date by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210760@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
To quickly convert date("N") to a 0 based index with Sunday being represented as 0, you
can run it against modulus 7:
<?php
$first_of_month_index = date('N', strtotime('4/1/1990')) % 7;
?>