You are here: Re: Interesting date « PHP Programming Language « IT news, forums, messages
Re: Interesting date

Posted by Kimmo Laine on 02/05/07 11:38

"Gunnar G" <debian@comhem.se> wrote in message
news:agExh.31203$E02.12820@newsb.telia.net...
>> 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.
> How can any one start counting from something else than zero in computer
> applications?

When dates are prsented in a numeric format, like YYYY-MM-DD, the months are
1-12, not 0-11 and this is what getdate outputs. No one said it's an array
offset, it's the ordinal number of the month. Calendars were invented before
computers. ;)

> Thanks! I'm so very, very stupid.

I've been equally stupid once. That's how I knew what to suspect. Try
formatting dates with the php built-in function date() to avoid confusions
like that.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация