Re: retrieve the day of the week
..oO(Alred Wallace)
>first the timestamp is the best way to find day of the week. A timestamp
>look like : 3215649870354 (secondes).
The best is to let the database handle that.
>I don't know how are stored your data. Let's imagine the worst: in a
>string!!
>and the month are stored like:jan, mar,feb...
>and not like 1 (jan), 2 (feb)...
>we will be forced to make an array.
>Let's begin the script:
>[...]
Have a look at strtotime().
<?php
$date = '11 Mar 2008 22:32:06';
print date('l', strtotime($date));
?>
Micha
|