glucopy.time_factor#

glucopy.time_factor(t: str)[source]#

Return the time factor of a given time string.

Parameters:

t (str) – The time string to be parsed, can be one of the following: - ‘s’: second - ‘m’: minute - ‘h’: hour

Returns:

The time factor of the given time string.

Return type:

int

Examples

Convert a time string to time factor

In [1]: import glucopy as gp

In [2]: gp.time_factor('s')
Out[2]: 1

In [3]: gp.time_factor('m')
Out[3]: 60

In [4]: gp.time_factor('h')
Out[4]: 3600