syedasimmeesaq
asked on
Windows Timestamp
Hi experts
I am trying to do some time calculations and I am using windows server 2003. I tried using the following statement below but it didn't work as it asks for unix timestamp, how can I change it to work with windows timestamp
UPDATE MyTable SET LockField=0 WHERE LockField<time(CURTIME())- 3600;
Thanks
I am trying to do some time calculations and I am using windows server 2003. I tried using the following statement below but it didn't work as it asks for unix timestamp, how can I change it to work with windows timestamp
UPDATE MyTable SET LockField=0 WHERE LockField<time(CURTIME())-
Thanks
ASKER
lockfield is text field
Thanks
Thanks
Can you prive information how the content of the column lockField look like e.g 2007-01-01 1:1:1 or something like 1223432432 ?
ASKER
hernst42 thanks for your reply. The contents are in this format
2008-01-29 14:17:27
so this has the year, month and date and then time is 2;17 pm which is represented by I guess military time, which is ok.
Hope that helps
thanks
2008-01-29 14:17:27
so this has the year, month and date and then time is 2;17 pm which is represented by I guess military time, which is ok.
Hope that helps
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this one gives me a blank page
Thanks
Thanks
ASKER
did this
UPDATE MyTable SET LockField=0 WHERE LockField < NOW() - 300;
but when I run the query, it sets up the field to 0 right away even if it had been only 5 second.
It is suppose to wait for 10 minutes time as the lock field has this value
date('Y-m-d H:i:s', gmmktime()) in this form 2008-01-30 16:43:49
UPDATE MyTable SET LockField=0 WHERE LockField < NOW() - 300;
but when I run the query, it sets up the field to 0 right away even if it had been only 5 second.
It is suppose to wait for 10 minutes time as the lock field has this value
date('Y-m-d H:i:s', gmmktime()) in this form 2008-01-30 16:43:49
There are also functions to use unix-timstamp in the database: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp