It's also perfectly possible to do without any knowledge of coding, but I consider the JS versions simpler ( working with time is not easy ). There are a number of expressions related to time available. If you take a look at the documentation for system expressions under the heading "time" you will see them. The one you want would be unixtime
, which returns the number of milliseconds since the epoch (1st of January 1970). We unfortunately don't have expressions to convert this into hours/minutes/seconds etc. so you have to apply some maths to get a useful answer. If you would rather use this method here are the expressions for converting unixtime into a more usable format.
Seconds = floor(unixtime / 1000) % 60
Minutes = floor(unixtime / (60 * 1000)) % 60
Hours = floor(unixtime / (60 * 60 * 1000) % 24
If your a little confused how those work basically they take the number of milliseconds since the epoch. Next they change it to the correct unit by dividing it ( 1000 ms in a second so divide by 1000, 60 seconds in a minute so divide by 60, etc. ). Then the value is floored (rounded down) so it's a whole number. Finally we use the modulo operator to wrap the value, keeping it in the range 0-60. In the seconds example this changes the value from second since the epoch, to seconds since the last minute.
One gotcha here is that that conversion doesn't include any timezone correction, so they are for UTC.
I'm happy to take a look at your project, but I don't appear to be able to access it from that link.