22.04.2020, 10:19
Hi!
I want to check if the local time is "greater" than a specific time, regardless of date.
As an example I want to check if the clock is more than 19 o'clock.
Is there a simple way to do this? Maybe with just two lines of scripting?
I understand that os.time(os.date('*t')) returns local time as the number of seconds from Thursday, 1 January 1970.
And os.time({year=2001, month=9, day=11, hour=13, minute=46}) returns also the number of seconds from Thursday, 1 January 1970.
But what I really want is os.time({hour=13, minute=46}), which I do not think is possible to write.
And I want to see if this time is before or later the local time os.date('*t'), but just hour and minutes.
Thanks for all your help!!
Kind regards,
Camilla
I want to check if the local time is "greater" than a specific time, regardless of date.
As an example I want to check if the clock is more than 19 o'clock.
Is there a simple way to do this? Maybe with just two lines of scripting?
I understand that os.time(os.date('*t')) returns local time as the number of seconds from Thursday, 1 January 1970.
And os.time({year=2001, month=9, day=11, hour=13, minute=46}) returns also the number of seconds from Thursday, 1 January 1970.
But what I really want is os.time({hour=13, minute=46}), which I do not think is possible to write.
And I want to see if this time is before or later the local time os.date('*t'), but just hour and minutes.
Thanks for all your help!!
Kind regards,
Camilla