Bases: datetime.tzinfo
datetime in UTC -> datetime in local time.
datetime -> string name of time zone.
Return a timestamp string for general use.
This function returns a timestamp string in the format YYYY-MM-DD-ddd-HH:MM:SS.mmmmmmm+HH:MM. If dt is not None, it should be a Python datetime.datetime object which will be formatted, otherwise, a datetime object is created by calling datetime.now().
>>> dt = datetime.datetime(2002, 12, 25, 13, 45, 56, 123456, _DummyTZ())
>>> get_timestamp(dt)
'2002-12-25-Wed-13:45:56.123456+0000'
The expected use will be to get a current time stamp, but this is hard to test.
>>> ts0 = get_timestamp()
>>> len(ts0)
35
>>> ts0[0:2], ts0[4], ts0[7]
('20', '-', '-')
Uncomment this to see what time it is :->.
>>> # ts0
The TIMESTAMP_RE object in this module is a compiled regular expression that matches a timestamp string and groups it into 9 parts: year, month, date, day, hour, minute, second, microsecond, and UTC offset.
>>> match = TIMESTAMP_RE.match(ts0)
>>> len(match.groups())
9