Re: convert numerical day of week
| From: | Tom Rogers | Date: | Wed, 23 May 2007 00:37:16 +0000 |
| Subject: | Re: convert numerical day of week | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255357@lists.php.net to get a copy of this message | ||
Hi,
Wednesday, May 23, 2007, 2:46:38 AM, you wrote:
BD> How can I convert the numerical day of week to the string version?
BD> Example, if the day of the week is 1 I would like to print out 'Sunday'.
BD>
BD> Thanks,
BD> Dave
<?php
$day =2;
//for a Monday start
echo gmdate('l',($day + 3) * 24 * 60 * 60)."\n";
// for a Sunday start
echo gmdate('l',($day + 2) * 24 * 60 * 60)."\n";
--
regards,
Tom