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

Posted by Todd on 10/08/06 21:00

The problem with your situation is that the dates are not stored in SQL
Server in strings like mm/dd/yyyy or dd/mm/yyy. The dates are stored as the
number of days before or after 1/1/1900. Times are stored in a similar
manner.

See http://msdn2.microsoft.com/en-us/library/ms187819.aspx

I suppose you could write some form of function that does a regexp check and
looks for date values on returned fields and then re-writes the date fields
in the format you want. This is an UGLY hack and would cause some overhead,
but it could work. The other option is that you could store your dates in a
char field and then you will get them back the way you want. Your would
have to do some checking on the date fields when entered to make sure they
are valid.

I don't know if either or these would work for you or not.

Good luck!

 

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

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