module loghelper.convert_helper
¶
Short summary¶
module pyquickhelper.loghelper.convert_helper
Various functions about conversions.
Functions¶
function |
truncated documentation |
---|---|
Converts a datetime into a string. |
|
convert a string into a datetime object, it can be: |
|
convert a timestamp into a datetime |
Documentation¶
Various functions about conversions.
- pyquickhelper.loghelper.convert_helper.datetime2str(dt)[source]¶
Converts a datetime into a string.
- Parameters:
dt – datetime
- Returns:
string
- pyquickhelper.loghelper.convert_helper.str2datetime(dt, format=None)[source]¶
- convert a string into a datetime object, it can be:
2013-05-24 18:49:46
2013-05-24 18:49:46.568
- Parameters:
dt – string
format – format for the conversion, the most complete one is
%Y-%m-%d %H:%M:%S.%f
which you get by default
- Return type:
datetime
- Returns:
datetime