Time Functions

betterfunctions.timefunctions.current_date(timezone='UTC')

Returns the current date in the specified timezone.

Parameters:

timezone (str, optional) – The timezone for which to return the date, specified as a UTC offset in the format ‘UTC[+-]HH:MM’, defaults to ‘UTC’.

Returns:

The current date in the format “dd.mm.yyyy”.

Return type:

str

betterfunctions.timefunctions.current_time(timezone='UTC')

Returns the current time in the specified timezone.

Parameters:

timezone (str, optional) – The timezone for which to return the time, specified as a UTC offset in the format ‘UTC[+-]HH:MM’, defaults to ‘UTC’.

Returns:

The current time in the format “HH:MM:SS”.

Return type:

str

betterfunctions.timefunctions.is_leap_year(year)

Checks if a year is a leap year.

Parameters:

year (int) – The year which should be checked.

Return type:

bool