WrightTools.kit.TimeStamp

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

Class for representing a moment in time.

__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

Methods

__init__([at, timezone])

Create a TimeStamp object.

Attributes

RFC3339

RFC3339.

RFC5322

RFC5322.

date

year-month-day.

hms

Get time formated.

human

Human-readable timestamp.

path

Timestamp for placing into filepaths.