You are not logged in.
Pages: 1
Sometimes I use SQL to update my database records (with Database.EngineExecute function). I know I have to manually update my TModTime value in this case.
But how?
I want update it with officail server time, so I need:
1) retrieve server time
2) convert it on integer value
3) update my database
Can you explane me how I can do 1) and 2).
Thanks
Offline
As explained by the documentation, you can retrieve the Server official time from the TSQLRest.ServerTimeStamp property.
This method is in fact immediate: an offset is retrieved at startup, and is used to compute the server time on the fly.
You can safely use the Int64 value retrieved by the TSQLRest.ServerTimeStamp property to update directly the corresponding field in your SQL code.
This is in fact what the ORM core of mORMot does for a TModTime value - see TSQLRecord.ComputeFieldsBeforeWrite.
Offline
Pages: 1