Module: lib-tde.function.datetime

This contains functions that help with manipulating time.

Info:

  • Copyright: 2020 Tom Meyers
  • Author: Tom Meyers

Static module functions

lib-tde.function.datetime.numberZeroPadding (number) -> () Adds a leading 0 if the number is smaller than 10
lib-tde.function.datetime.numberInSecToMS (number) -> () Format the amount of seconds to MM:SS (M = minutes, S = seconds)
lib-tde.function.datetime.current_time_inbetween (time_start, time_end) -> () Check if the current system time is in between 2 time's


Static module functions

lib-tde.function.datetime.numberZeroPadding (number) -> ()
Adds a leading 0 if the number is smaller than 10

Parameters:

  • number integer the number to pad zero's in front of

Returns:

    string a string representing the number with padded zero's

Usage:

    -- This will return 06
     lib-tde.function.datetime.numberZeroPadding(6)
lib-tde.function.datetime.numberInSecToMS (number) -> ()
Format the amount of seconds to MM:SS (M = minutes, S = seconds)

Parameters:

  • number integer the number in seconds that need to be converted to a MINUTE:SECOND string representation

Returns:

    string The string format of the time in MM:SS

Usage:

    -- This will return 02:06
     lib-tde.function.datetime.leadingZero(126)
lib-tde.function.datetime.current_time_inbetween (time_start, time_end) -> ()
Check if the current system time is in between 2 time's

Parameters:

  • time_start string A string in the form HH:MM (Hour:Minute) representing the start time
  • time_end string A string in the form HH:MM (Hour:Minute) representing the end time

Returns:

    boolean Returns if the system time is between these numbers

Usage:

    -- This will return True if the system time is before 1 pm
     lib-tde.function.datetime.current_time_inbetween("00:00", "13:00")
generated by LDoc 1.4.6 Build with 💜 By F0xedb Last updated 2021-05-21 03:30:15