Documentation

Std.Time.DateTime.Timestamp

Represents an exact point in time as a UNIX Epoch timestamp.

Instances For
    Equations
    Equations
    • Std.Time.instOfNatTimestamp = { ofNat := { val := OfNat.ofNat n } }
    @[extern lean_get_current_time]

    Fetches the current duration from the system.

    @[inline]

    Converts a Timestamp to minutes as Minute.Offset.

    Equations
    Instances For
      @[inline]

      Converts a Timestamp to days as Day.Offset.

      Equations
      Instances For
        @[inline]

        Creates a Timestamp from a Second.Offset since the Unix epoch.

        Equations
        Instances For
          @[inline]

          Creates a Timestamp from a Nanosecond.Offset since the Unix epoch.

          Equations
          Instances For
            @[inline]

            Creates a Timestamp from a Millisecond.Offset since the Unix epoch.

            Equations
            Instances For
              @[inline]

              Converts a Timestamp to seconds as Second.Offset.

              Equations
              • t.toSecondsSinceUnixEpoch = t.val.second
              Instances For
                @[inline]

                Converts a Timestamp to nanoseconds as Nanosecond.Offset.

                Equations
                Instances For
                  @[inline]

                  Converts a Timestamp to nanoseconds as Millisecond.Offset.

                  Equations
                  • tm.toMillisecondsSinceUnixEpoch = tm.toNanosecondsSinceUnixEpoch.toMilliseconds
                  Instances For
                    @[inline]

                    Calculates the duration from the given Timestamp to the current time.

                    Equations
                    Instances For
                      @[inline]

                      Returns the Duration represented by the Timestamp since the Unix epoch.

                      Equations
                      • tm.toDurationSinceUnixEpoch = tm.val
                      Instances For
                        @[inline]

                        Adds a Millisecond.Offset to the given Timestamp.

                        Equations
                        • t.addMilliseconds s = { val := t.val + s }
                        Instances For
                          @[inline]

                          Subtracts a Millisecond.Offset from the given Timestamp.

                          Equations
                          • t.subMilliseconds s = { val := t.val - s }
                          Instances For
                            @[inline]

                            Adds a Nanosecond.Offset to the given Timestamp.

                            Equations
                            Instances For
                              @[inline]

                              Subtracts a Nanosecond.Offset from the given Timestamp.

                              Equations
                              Instances For
                                @[inline]

                                Adds a Second.Offset to the given Timestamp.

                                Equations
                                Instances For
                                  @[inline]

                                  Subtracts a Second.Offset from the given Timestamp.

                                  Equations
                                  Instances For
                                    @[inline]

                                    Adds a Minute.Offset to the given Timestamp.

                                    Equations
                                    Instances For
                                      @[inline]

                                      Subtracts a Minute.Offset from the given Timestamp.

                                      Equations
                                      Instances For
                                        @[inline]

                                        Adds an Hour.Offset to the given Timestamp.

                                        Equations
                                        Instances For
                                          @[inline]

                                          Subtracts an Hour.Offset from the given Timestamp.

                                          Equations
                                          Instances For
                                            @[inline]

                                            Adds a Day.Offset to the given Timestamp.

                                            Equations
                                            Instances For
                                              @[inline]

                                              Subtracts a Day.Offset from the given Timestamp.

                                              Equations
                                              Instances For
                                                @[inline]

                                                Subtracts a Week.Offset from the given Timestamp.

                                                Equations
                                                Instances For
                                                  @[inline]

                                                  Adds a Duration to the given Timestamp.

                                                  Equations
                                                  • t.addDuration d = { val := t.val + d }
                                                  Instances For
                                                    @[inline]

                                                    Subtracts a Duration from the given Timestamp.

                                                    Equations
                                                    • t.subDuration d = { val := t.val - d }
                                                    Instances For