Count Up Timer?
Mark Smith
marksmithhfx at gmail.com
Mon Nov 1 18:29:48 EDT 2021
You want the convert command. convert 1605553200 from seconds to dateitems gives you 2020,11,16,19,0,0,2 (lookup dateitems). convert the date && the time to seconds gives the date/time right now = 1635805440, then do the same as step one with that gives you 2021,11,1,22,24,0,2. Do a little subtraction and you get 1 yr, 0 months, 15 days, 3 hours, 24 mins, 0 secs.
> On Nov 1, 2021, at 9:45 PM, Dan Friedman via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Anyone ever done a count up timer? For example, if we supply the seconds of 1605553200, we want to display the number of years, months, days, hours, minutes and seconds since that time. For example, "How long have you been alive?". This needs to be precise – need to account for leap years, days in month, etc.
>
> Save me!! :)
>
> -Dan
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list