Skip to main content

convert_pytime

No overview available.

def convert_pytime(
pytime: datetime,
format_string: string = %Y-%m-%d %H:%M:%S
) - > string

Converts a Python datetime object into a formatted string or a specific timestamp format suitable for API consumption or database storage.

Parameters

NameTypeDescription
pytimedatetimeThe Python datetime object to be converted into a string format.
format_stringstring = %Y-%m-%d %H:%M:%SThe strftime-compatible format pattern used to determine the structure of the output string.

Returns

TypeDescription
stringThe formatted date and time string representing the input datetime object.