Hey guys! How can I store the following format of date and time in database?
Date=Mon 01th Oct
Time=5 :00pm
Hey guys! How can I store the following format of date and time in database?
Date=Mon 01th Oct
Time=5 :00pm
Don't. Store timestamps, then convert later, using date($format,$stamp);
Much more versatile and easier to store as well.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Is it look like that?
How can I convert them to desired format using PHP?Code:`reserve_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `reserve_time` timestamp NOT NULL default '0000-00-00 00:00:00',
Go to php.net. Type "date" in the search field. See formats. Easy.
You'll be storing a timestamp value into the database, which will be the number of seconds since 1970. It's 1100000000 something right now, or so. use time() to get that. There's also a keyword in mysql, I believe %date% or something, but I forget the details. Look that up.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks