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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация