TidalPy.utilities.string_helper package
Submodules
TidalPy.utilities.string_helper.string_helper module
- TidalPy.utilities.string_helper.string_helper.convert_time_to_hhmmss(time: float, return_days: bool = False)[source]
Convert time from seconds to hours, minutes, seconds
- Parameters:
time (float) – Time in seconds
return_days (bool = False) – If True, then days will be calculated in addition to hh, mm, ss
- Returns:
hhmmss_str – str with hours minutes and seconds
- Return type:
str
- TidalPy.utilities.string_helper.string_helper.timestamped_str(date: bool = True, time: bool = True, second: bool = False, millisecond: bool = False, string_to_stamp: str = '', preappend: bool = True, separation: str = '_', provided_datetime=None) str[source]
Creates a timestamp string at the current time and date.
- Parameters:
date (bool = True) – Whether or not the date will be included in the timestamp
time (bool = True) – Whether or not the time will be included in the timestamp
second (bool = False) – Whether or not the second will be included in the timestamp
millisecond (bool = False) – Whether or not the date will be included in the timestamp
string_to_stamp (str = None) – Another string to add before or after timestamp
preappend (bool = True) – Determines where the timestamp will be appended relative to the provided string
separation (str = '_') – Character that separates the timestamp and any provided string
provided_datetime (datetime.datetime = None) – A datetime.datetime object. If none provided the function will use call time
- Returns:
timestamped_str – String with the current date and/or time added on.
- Return type:
str