You are here: Re: Date field in DD/MM/YYY « PHP Programming Language « IT news, forums, messages
Re: Date field in DD/MM/YYY

Posted by larry on 10/28/07 05:29

On Oct 27, 11:01 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(la...@portcommodore.com)
>
> >I prefer to store my dates in YYYYMMDD format on my tables for
> >compactness and readability
>
> This is not a problem as long as a proper date type is used in the table
> (DATE or DATETIME for example). In MySQL dates are stored as YYYY-MM-DD
> strings, but YYYYMMDD is also possible in a numeric context.
>
> >and worked up a bunch of functions for
> >working with them
>
> Looks pretty complicated. MySQL and PHP have a lot of date functions,
> which already can do most of that. With properly stored dates such
> calculations are as easy as adding two integers. MySQL is also able to
> return Unix timestamps, which can then easily be used with PHP's date
> functions.
>
[snip]
>
> You might want to consider to use regular expressions, which makes it
> very easy to test against different patterns.
>
> Micha

For the format, I was thinking of long term or DB agnostic, where I
may not have MySQL compatible fields, so I went with integer.

As for regular expressions haven't quite got the hang of those yet (at
least it is all in one place so I can fix it when I do.)

 

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

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