Re: [PHP] Re: calculating datetime

2003-08-31 Thread Ryan A
Hi, Thanks for replying. Am a bit confused even after your example as to how to enter this into the datetime field in mysql so that i can compare it to the present datetime heres the code i made based on what you said: ?php $day=2; $hour=2; $seconds=05; $theDay=24*60*60; $theHour=60*60;

Re: [PHP] Re: calculating datetime

2003-08-31 Thread Raditha Dissanayake
Hello Ryan, If you find the php date time functions not to your liking you will finder more easy to understand version in mysql. all the best Ryan A wrote: Hi, Thanks for replying. Am a bit confused even after your example as to how to enter this into the datetime field in mysql so that i can

Re: [PHP] Re: calculating datetime

2003-08-31 Thread raditha dissanayake
Why am i saying 'finder' ? not enough coffee :-) i meant find a. Raditha Dissanayake wrote: Hello Ryan, If you find the php date time functions not to your liking you will finder more easy to understand version in mysql. all the best Ryan A wrote: Hi, Thanks for replying. Am a bit confused

Re: [PHP] Re: calculating datetime

2003-08-31 Thread Catalin Trifu
Hi, You have to take into consideration the behaviour of the datetime data type in MySQL. Look at the documentation http://www.mysql.com/doc/en/DATETIME.html I think the field type you need should be TIMESTAMP(14) since you can use some MySQL functions to easily check for expired

[PHP] Re: calculating datetime

2003-08-31 Thread Catalin Trifu
Hi, offset = 1day + 1hour + 10 secs = 24 * 60 * 60 + 60 * 60 + 10 (seconds) time() + offset = the time you need or $now = explode('.', date(d.m.Y.H.i.s, time()); $now is array ( 0 = the day, 1 = the month. aso) add to the elements of the array the values you need