Skip to content

Date

This variable is used to format and use dates.

Format

Initial value can, other than a parseable datetime string, be now. Each time the variable is accessed the value will represent that date and time at the time of access.

Arguments

  • format str - a python strftime format string, this argument is required
  • timezone str (optional) - a valid timezone name
  • offset str (optional) - a time span string describing the offset, Y = years, M = months, D = days, h = hours, m = minutes, s = seconds, e.g. 1Y-2M10D

Example

And value for variable "AtomicDate.arrival" is "now | format='%Y-%m-%dT%H:%M:%S.000Z', timezone=UTC"

This can then be used in a template:

{
    "arrival": "{{ AtomicDate.arrival }}",
    "location": "Port of Shanghai"
}

atomicdate__base_type__

def atomicdate__base_type__(value: str) -> str

[view_source]

Validate values that AtomicDate can be initialized with.