Link to home
Start Free TrialLog in
Avatar of syedasimmeesaq
syedasimmeesaqFlag for United States of America

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
Avatar of hernst42
hernst42
Flag of Germany image

Which type is the field  LockField in the database?

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
Avatar of syedasimmeesaq

ASKER

lockfield is text field

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 ?
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
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this one gives me a blank page
Thanks
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