Time

class pyarts.arts.Time(*args, **kwargs)

Represents a time stamp

Workspace methods that require Time

Overview

Method

readxml()

Read variable from file

Method

savexml()

Saves variable to file

Static Method

fromxml()

Create variable from file

Attribute

sec

float Time from Unix start

Attribute

time

datetime.datetime The time

Operator

__add__()

Allows self + n

Operator

__eq__()

Return self==value.

Operator

__ge__()

Return self>=value.

Operator

__gt__()

Return self>value.

Operator

__hash__()

Return hash(self).

Operator

__le__()

Return self<=value.

Operator

__lt__()

Return self<value.

Operator

__ne__()

Return self!=value.

Operator

__radd__()

Allows n + self

Operator

__rsub__()

Allows n - self

Constructors

__init__(self) None
__init__(self, arg: pyarts.arts.Time) None
__init__(self, arg: datetime.datetime, /) None
__init__(self, arg: float, /) None
__init__(self, arg: str, /) None

Overloaded function.

  1. __init__(self) -> None

  2. __init__(self, arg: pyarts.arts.Time) -> None

  3. __init__(self, arg: datetime.datetime, /) -> None

From datetime.datetime

  1. __init__(self, arg: float, /) -> None

From float seconds from Unix time start

  1. __init__(self, arg: str, /) -> None

From str of form “YYYY-MM-DD hh:mm:ss”

Methods

readxml(self, file: str) None

Read variable from file

Parameters:

file (str) – A file that can be read

On Error:

Throws RuntimeError for any failure to read

savexml(self, file: str, type: str = 'ascii', clobber: bool = True) None

Saves variable to file

Parameters:
  • file (str) – The path to which the file is written. Note that several of the options might modify the name or write more files

  • type (str) – Type of file to save. See FileType for options.

  • clobber (bool) – Overwrite existing files or add new file with modified name?

On Error:

Throws RuntimeError for any failure to save

Static Methods

fromxml(file: str) pyarts.arts.Time

Create variable from file

Parameters:

file (str) – A file that can be read

On Error:

Throws RuntimeError for any failure to read

Attributes

sec

float Time from Unix start

time

datetime.datetime The time

Operators

__add__(self, n: float) pyarts.arts.Time

Allows self + n

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__radd__(self, n: float) pyarts.arts.Time

Allows n + self

__rsub__(self, n: float) pyarts.arts.Time

Allows n - self