note 65692 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 02:58:13 +0000 |
| Subject: | note 65692 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142007@lists.php.net to get a copy of this message | ||
If you do not PHP5 yet but want a week day to be in ISO format: 1 (for Monday) through 7 (for
Sunday), you can use this:
<?php
//GET WEEK DAY 0 FOR SUNDAY, 6 FOR SATURDAY
$x = date( "w" );
$corrected_week_day = 7 - ( (7-$x) % (7+$x) );
?>
--was--
If you do not PHP5 yet but want a week day to be in ISO format: 1 (for Monday) through 7 (for
Sunday), you can use this:
<?
//GET WEEK DAY 0 FOR SUNDAY, 6 FOR SATURDAY
$x = date( "w" );
$corrected_week_day = 7 - ( (7-$x) % (7+$x) );
?>
http://php.net/manual/en/function.date.php