Documentation

Std.Time.Zoned.DateTime

structure Std.Time.DateTime (tz : TimeZone) :

Represents a specific point in time associated with a TimeZone.

  • timestamp : Timestamp

    Timestamp represents the exact moment in time. It's a UTC related Timestamp.

  • Date is a Thunk containing the PlainDateTime that represents the local date and time, it's used for accessing data like day and month without having to recompute the data every time.

Instances For
    @[implicit_reducible]
    @[implicit_reducible]
    @[inline]

    Creates a new DateTime out of a Timestamp that is in a TimeZone.

    Instances For
      @[implicit_reducible]

      Returns the number of days since the UNIX epoch.

      Instances For
        @[inline]

        Creates a Timestamp out of a DateTime.

        Instances For
          @[inline]
          def Std.Time.DateTime.convertTimeZone {tz : TimeZone} (date : DateTime tz) (tz₁ : TimeZone) :
          DateTime tz₁

          Changes the TimeZone to a new one.

          Instances For
            @[inline]

            Creates a new DateTime out of a PlainDateTime. It assumes that the PlainDateTime is the Local date time.

            Instances For
              @[inline]

              Add Hour.Offset to a DateTime.

              Instances For
                @[inline]

                Subtract Hour.Offset from a DateTime.

                Instances For
                  @[inline]

                  Add Minute.Offset to a DateTime.

                  Instances For
                    @[inline]

                    Subtract Minute.Offset from a DateTime.

                    Instances For
                      @[inline]

                      Add Second.Offset to a DateTime.

                      Instances For
                        @[inline]

                        Subtract Second.Offset from a DateTime.

                        Instances For
                          @[inline]

                          Add Millisecond.Offset to a DateTime.

                          Instances For
                            @[inline]

                            Subtract Millisecond.Offset from a DateTime.

                            Instances For
                              @[inline]

                              Add Nanosecond.Offset to a DateTime.

                              Instances For
                                @[inline]

                                Subtract Nanosecond.Offset from a DateTime.

                                Instances For
                                  @[inline]

                                  Add Day.Offset to a DateTime.

                                  Instances For
                                    @[inline]

                                    Subtracts Day.Offset to a DateTime.

                                    Instances For
                                      @[inline]

                                      Add Week.Offset to a DateTime.

                                      Instances For
                                        @[inline]

                                        Subtracts Week.Offset to a DateTime.

                                        Instances For

                                          Add Month.Offset to a DateTime, it clips the day to the last valid day of that month.

                                          Instances For
                                            @[inline]

                                            Subtracts Month.Offset from a DateTime, it clips the day to the last valid day of that month.

                                            Instances For

                                              Add Month.Offset from a DateTime, this function rolls over any excess days into the following month.

                                              Instances For
                                                @[inline]

                                                Subtract Month.Offset from a DateTime, this function rolls over any excess days into the following month.

                                                Instances For
                                                  @[inline]

                                                  Add Year.Offset to a DateTime, this function rolls over any excess days into the following month.

                                                  Instances For
                                                    @[inline]

                                                    Add Year.Offset to a DateTime, it clips the day to the last valid day of that month.

                                                    Instances For
                                                      @[inline]

                                                      Subtract Year.Offset from a DateTime, this function rolls over any excess days into the following month.

                                                      Instances For
                                                        @[inline]

                                                        Subtract Year.Offset from to a DateTime, it clips the day to the last valid day of that month.

                                                        Instances For
                                                          @[inline]

                                                          Creates a new DateTime tz by adjusting the day of the month to the given days value, with any out-of-range days clipped to the nearest valid date.

                                                          Instances For
                                                            @[inline]

                                                            Creates a new DateTime tz by adjusting the day of the month to the given days value, with any out-of-range days rolled over to the next month or year as needed.

                                                            Instances For
                                                              @[inline]

                                                              Creates a new DateTime tz by adjusting the month to the given month value. The day remains unchanged, and any invalid days for the new month will be handled according to the clip behavior.

                                                              Instances For
                                                                @[inline]

                                                                Creates a new DateTime tz by adjusting the month to the given month value. The day is rolled over to the next valid month if necessary.

                                                                Instances For
                                                                  @[inline]

                                                                  Creates a new DateTime tz by adjusting the year to the given year value. The month and day remain unchanged, and any invalid days for the new year will be handled according to the clip behavior.

                                                                  Instances For
                                                                    @[inline]

                                                                    Creates a new DateTime tz by adjusting the year to the given year value. The month and day are rolled over to the next valid month and day if necessary.

                                                                    Instances For
                                                                      @[inline]

                                                                      Creates a new DateTime tz by adjusting the hour component.

                                                                      Instances For
                                                                        @[inline]

                                                                        Creates a new DateTime tz by adjusting the minute component.

                                                                        Instances For
                                                                          @[inline]

                                                                          Creates a new DateTime tz by adjusting the second component.

                                                                          Instances For
                                                                            @[inline]

                                                                            Creates a new DateTime tz by adjusting the nano component.

                                                                            Instances For
                                                                              @[inline]

                                                                              Creates a new DateTime tz by adjusting the millisecond component.

                                                                              Instances For
                                                                                @[inline]

                                                                                Converts a Timestamp to a PlainDateTime

                                                                                Instances For
                                                                                  @[inline]

                                                                                  Getter for the Year inside of a DateTime

                                                                                  Instances For
                                                                                    @[inline]

                                                                                    Getter for the Month inside of a DateTime

                                                                                    Instances For
                                                                                      @[inline]

                                                                                      Getter for the Day inside of a DateTime

                                                                                      Instances For
                                                                                        @[inline]

                                                                                        Getter for the Hour inside of a DateTime

                                                                                        Instances For
                                                                                          @[inline]

                                                                                          Getter for the Minute inside of a DateTime

                                                                                          Instances For
                                                                                            @[inline]

                                                                                            Getter for the Second inside of a DateTime

                                                                                            Instances For
                                                                                              @[inline]

                                                                                              Getter for the Milliseconds inside of a DateTime

                                                                                              Instances For
                                                                                                @[inline]

                                                                                                Getter for the Nanosecond inside of a DateTime

                                                                                                Instances For
                                                                                                  @[inline]

                                                                                                  Gets the Weekday of a DateTime.

                                                                                                  Instances For

                                                                                                    Determines the era of the given DateTime based on its year.

                                                                                                    Instances For
                                                                                                      def Std.Time.DateTime.withWeekday {tz : TimeZone} (dt : DateTime tz) (desiredWeekday : Weekday) :

                                                                                                      Sets the DateTime to the specified desiredWeekday.

                                                                                                      Instances For

                                                                                                        Checks if the DateTime is in a leap year.

                                                                                                        Instances For

                                                                                                          Determines the ordinal day of the year for the given DateTime.

                                                                                                          Instances For
                                                                                                            @[inline]

                                                                                                            Determines the week of the year for the given DateTime, using firstDay as the start of the week.

                                                                                                            Instances For
                                                                                                              @[inline]

                                                                                                              Returns the week-based year for the given DateTime, using firstDay as the start of the week. The week-based year may differ from the calendar year for dates near the start or end of the year.

                                                                                                              Instances For

                                                                                                                Returns the unaligned week of the month for a DateTime (day divided by 7, plus 1).

                                                                                                                Instances For
                                                                                                                  @[inline]

                                                                                                                  Determines the week of the month for the given DateTime, using firstDay as the start of the week.

                                                                                                                  Instances For
                                                                                                                    @[inline]

                                                                                                                    Determines the quarter of the year for the given DateTime.

                                                                                                                    Instances For
                                                                                                                      @[inline]

                                                                                                                      Getter for the PlainTime inside of a DateTime

                                                                                                                      Instances For
                                                                                                                        @[inline]

                                                                                                                        Creates a DateTime from a number of days since the 1970-01-01T00:00:00.

                                                                                                                        Instances For
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]
                                                                                                                          @[implicit_reducible]