Part of bzrlib
Function | format_highres_date | Format a date, such that it includes higher precision in the |
Function | unpack_highres_date | This takes the high-resolution date stamp, and |
Function | format_patch_date | Format a POSIX timestamp and optional offset as a patch-style date. |
Function | parse_patch_date | Parse a patch-style date into a POSIX timestamp and offset. |
Format a date, such that it includes higher precision in the seconds field.
Example: format_highres_date(time.time(), -time.timezone) this will return a date stamp for right now, formatted for the local timezone.
>>> from bzrlib.osutils import format_date >>> format_date(1120153132.350850105, 0) 'Thu 2005-06-30 17:38:52 +0000' >>> format_highres_date(1120153132.350850105, 0) 'Thu 2005-06-30 17:38:52.350850105 +0000' >>> format_date(1120153132.350850105, -5*3600) 'Thu 2005-06-30 12:38:52 -0500' >>> format_highres_date(1120153132.350850105, -5*3600) 'Thu 2005-06-30 12:38:52.350850105 -0500' >>> format_highres_date(1120153132.350850105, 7200) 'Thu 2005-06-30 19:38:52.350850105 +0200' >>> format_highres_date(1152428738.867522, 19800) 'Sun 2006-07-09 12:35:38.867522001 +0530'
Parameters | t | The local time in fractional seconds since the epoch (type: float) |
offset | The timezone offset in integer seconds (type: int) |
Parameters | date | A date formated by format_highres_date (type: string) |