Reply to Re: Storing time in MySQL

Your name:

Reply:


Posted by Tom on 03/30/07 18:07

On Thu, 29 Mar 2007 01:06:02 +1000, Schmalz wrote...
>
>Hi again all,
>
>Just here to pick some more brains.
>
>I have some code that gets a date from a MySQL database and does some weird
>and wonderful calucaltions with it.
>
>I wish to store the end result back into the MySQL database. When I try it,
>using a number of different methods, it doesn't work.
>
>Any ideas as to the best way to store a date in a MySQL database using php?
>
>Thanks again in advance.
>
>Regards,
>
>Schmalz
>
>

Depending how you have the column configured in your table, you probably have to
format the entry a specific way. As an example, I have a different tables with
different references to date/time.

On the first is use "timestamp" so I need to format my date like

YYYYMMDDHHMMSS
20070216163235

On the other it uses "datetime" so I need to use this format instead

YYYY-MM-DD HH:MM:SS
2007-02-16 16:32:35

Tom
--
Newsguy.com
75+ Days Retention!
Higher levels of article completion!
Broader newsgroups coverage

[Back to original 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

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