Page 1 of 1

time/date function into time/date type field in mysql

Posted: Thu Aug 18, 2005 3:31 am
by mickd
hi, i was wondering if anyone could clear up a small problem i have.

could anyone enlighten me on how to insert a date/time into a date/time field? do you have to use the php date/time function?

also,

once a date/time is entered into the field, how would you go about editing it say for example increase the date by 1 day every day? (not reset it to the current date)

thanks, any help appriciated.

Posted: Thu Aug 18, 2005 3:34 am
by s.dot
What is the current date formate for date/time you have?

If it's like Jan 05, 2005 at 12:58 PM -- then it'd be varchar
If it's a unix timestamp -- then int

etc...

Also, to get your date to change every day you'd have to have a script ran every day that would do that, or run a cron job

Posted: Thu Aug 18, 2005 6:18 am
by timvw
If i need to change a lot of timestamps everyday it's probably a bad solution.. In that case i would suggest calculating the actual timestap based on the difference between now() and the original timestamp.


Anyway, a little search on this forum will return a load of useful posts that mention the options to handle date and time between php and mysql. Probably ADOdb has the most powerful feature because you can it accros different DBMS.