Documentation

Cedar.Spec.Ext.Datetime

This file defines Cedar datetime values and functions.

A datetime value is measured in milliseconds and constructed from a datetime string. A datetime string must be of one of the forms:

  • YYYY-MM-DD (date only)
  • YYYY-MM-DDThh:mm:ssZ (UTC)
  • YYYY-MM-DDThh:mm:ss.SSSZ (UTC with millisecond precision)
  • YYYY-MM-DDThh:mm:ss(+|-)hhmm (With timezone offset in hours and minutes)
  • YYYY-MM-DDThh:mm:ss.SSS(+|-)hhmm (With timezone offset in hours and minutes and millisecond precision)

Regardless of the timezone, offset is always normalized to UTC.

The datetime type does not provide a way to create a datetime from a Unix timestamp. One of the readable formats listed above must be used instead.

Instances For
    Equations
    Instances For
      Equations
      Instances For
        instance Cedar.Spec.Ext.Datetime.decLt (d₁ d₂ : Datetime) :
        Decidable (d₁ < d₂)
        Equations
        instance Cedar.Spec.Ext.Datetime.decLe (d₁ d₂ : Datetime) :
        Decidable (d₁ d₂)
        Equations
        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            A duration value is measured in milliseconds and constructed from a duration string. A duration string is a concatenated sequence of quantity-unit pairs where the quantity is a natural number and unit is one of the following:

            • d (for days)
            • h (for hours)
            • m (for minutes)
            • s (for seconds)
            • ms (for milliseconds)

            Duration strings are required to be ordered from largest unit to smallest unit, and contain one quantity per unit. Units with zero quantity may be omitted.

            A duration may be negative. Negative duration strings must begin with -.

            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                Instances For
                  Equations
                  Instances For
                    Equations
                    Instances For
                      instance Cedar.Spec.Ext.Datetime.Duration.decLt (d₁ d₂ : Duration) :
                      Decidable (d₁ < d₂)
                      Equations
                      instance Cedar.Spec.Ext.Datetime.Duration.decLe (d₁ d₂ : Duration) :
                      Decidable (d₁ d₂)
                      Equations

                      Create a Duration from an Int representing its internal encoding. Most callers should use higher-level constructors, e.g., Duration.parse

                      Equations
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Equations
                          Instances For
                            Equations
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  Instances For
                                    Equations
                                    Instances For
                                      Equations
                                      Instances For
                                        Equations
                                        Instances For
                                          Equations
                                          Instances For