WrightTools.kit.TimeStamp

class WrightTools.kit.TimeStamp(at=None, timezone='local')[source]

Bases: object

Class for representing a moment in time.

RFC3339

RFC3339.

Link to RFC3339.

RFC5322

RFC5322.

Link to RFC5322.

__init__(at=None, timezone='local')[source]

Create a TimeStamp object.

Parameters:
  • at (float (optional)) – Seconds since epoch (unix time). If None, current time will be used. Default is None.
  • timezone (string or integer (optional)) – String (one in {‘local’, ‘utc’} or seconds offset from UTC. Default is local.
unix

Seconds since epoch (unix time).

Type:float
date

Date.

Type:string
hms

Hours, minutes, seconds.

Type:string
human

Representation of the timestamp meant to be human readable.

Type:string
legacy

Legacy WrightTools timestamp representation.

Type:string
RFC3339

RFC3339 representation (recommended for most applications).

Type:string
RFC5322

RFC5322 representation.

Type:string
path

Representation of the timestamp meant for inclusion in filepaths.

Type:string
date

year-month-day.

hms

Get time formated.

HH:MM:SS

human

Human-readable timestamp.

path

Timestamp for placing into filepaths.