You are here: Re: Date formatting issue « All PHP « IT news, forums, messages
Re: Date formatting issue

Posted by boclair on 08/08/06 01:35

Chris wrote:
> I am also having an issue with dates - I have a js calendar pop-up for
> selecting the date to insert into a text box. It is formatted to show the
> date as mm/dd/yyyy. However, the dates in the mySQL db show as yyyy-mm-dd,
> and I have noted that when I try to input a new date into the database via
> the form, all the db shows is 0000-00-00. Do I need to format the date some
> way that it will go into the db the same way the db displays? Can I change
> to format of the date field in the db? I researched this, but only came up
> with ways to change the display in the Select results (works great for
> printing out the date). Do I need to forget the calendar pop-up and just
> have users input the date using an example format?
>
> Thanks,
> Chris

A simple method.

Split() given date into an array and list() the variables. Reorder date.

Perhaps convert to unix time with strtotime() before inserting into DB?

Louise

 

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

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