On 18 Sep 2012, at 22:38, "Franks Andy \(RLZ\) IT Systems Engineer" <Andy.Franks@sath.nhs.uk> wrote:
Hi,
Hopefully a simple question. I’ve looked around for a while but can’t find the answer to this.
I’d like to be able to take a date/time from a sql database, use unlang (not a module) to compare it to the current time and make a decision based on the fact that it’s, for example, less or more than 3600 seconds/60 minutes/1 hour etc ago.
Use one of the SQL functions (UNIX_TIMESTAMP()) to pull the date field value out as an integer and do a straight comparison with "%{l}". Or if you write a SQL timestamp string into a date type attribute, it might be smart enough to parse it for you, and then you can do "%{integer:Timestamp-Attr}" and compare with "%{l}". Not 100% sure the code is there to do that though... -Arran