Re: Interesting date
- From: "Kimmo Laine" <spam@xxxxxxxxxxxxx>
- Date: Mon, 5 Feb 2007 13:05:22 +0200
"Gunnar G" <debian@xxxxxxxxx> wrote in message
news:sPDxh.31199$E02.12885@xxxxxxxxxxxxxxxxxx
I'm trying to compute the date 250 days ago and I get this
$now = getdate(strtotime("now"));
$old = getdate(strtotime("-250 days"));
and I get right now with
$old["mon"] and $old["mday"]
31 june. Well, that doesn't sound right.
Can you spot the error?
Here's what I gets:
$now = Array
(
[seconds] => 36
[minutes] => 58
[hours] => 12
[mday] => 5
[wday] => 1
[mon] => 2
[year] => 2007
[yday] => 35
[weekday] => Monday
[month] => February
[0] => 1170673116
)
$old = Array
(
[seconds] => 36
[minutes] => 58
[hours] => 12
[mday] => 31
[wday] => 3
[mon] => 5
[year] => 2006
[yday] => 150
[weekday] => Wednesday
[month] => May
[0] => 1149069516
)
Now this is just a guess, but if 'june' comes from an array starting with
zero, so that 0=january, then 4=may and 5=june, it propably should start
from 1=january and in that case 5 would actually be may... If that doesn't
help, see the whole output of getdate with print_r() and post the result
here.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@xxxxxxxxxxxxx | rot13(xvzzb@xxxxxxxxxxxxx)
.
- Follow-Ups:
- Re: Interesting date
- From: Gunnar G
- Re: Interesting date
- References:
- Interesting date
- From: Gunnar G
- Interesting date
- Prev by Date: Re: Best text search for many Gigabyte Database?
- Next by Date: Re: Interesting date
- Previous by thread: Interesting date
- Next by thread: Re: Interesting date
- Index(es):