Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql date set

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE
Hey everbody,

I have $datum = date("l dS of F Y h:i:s A"); ... Now I want to store $datum in my mysql database. How can I do this? I only know that I can store a date in my database if the date is yyyy-mm-dd. But now the date is something like 'Wednesday 14th of January 2004 06:13:41 PM'. How can I store this date and time in my database?

The One And Only KryptoS
 
try:

$yournewdate = date("yyyy-MM-dd HH:mm:ss", $datum);



Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
ok I found it ...

the fild of the date in my database must be 'datetime'. And then my var must be $datum = date("Y-m-d h:i:s");

The One And Only KryptoS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top