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;
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
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
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
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
5 matches
Mail list logo