Documentation

Std.Time.DateTime.PlainDateTime

Represents a date and time with components for Year, Month, Day, Hour, Minute, Second, and Nanosecond.

Instances For
    Equations

    Converts a PlainDateTime to a Timestamp

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

      Converts a Timestamp to a PlainDateTime.

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

        Converts a PlainDateTime to the number of days since the UNIX epoch.

        Equations
        • pdt.toDaysSinceUNIXEpoch = pdt.date.toDaysSinceUNIXEpoch
        Instances For
          @[inline]

          Converts a PlainDateTime to the number of days since the UNIX epoch.

          Equations
          Instances For

            Sets the PlainDateTime to the specified desiredWeekday.

            Equations
            • dt.withWeekday desiredWeekday = { date := dt.date.withWeekday desiredWeekday, time := dt.time }
            Instances For
              @[inline]

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

              Equations
              Instances For
                @[inline]

                Creates a new PlainDateTime 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.

                Equations
                Instances For
                  @[inline]

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

                  Equations
                  Instances For
                    @[inline]

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

                    Equations
                    Instances For
                      @[inline]

                      Creates a new PlainDateTime by adjusting the year to the given year value. The month and day remain unchanged, with any out-of-range days clipped to the nearest valid date.

                      Equations
                      Instances For
                        @[inline]

                        Creates a new PlainDateTime 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.

                        Equations
                        Instances For
                          @[inline]

                          Creates a new PlainDateTime by adjusting the hour component of its time to the given value.

                          Equations
                          • dt.withHours hour = { date := dt.date, time := let __src := dt.time; { hour := hour, minute := __src.minute, second := __src.second, nanosecond := __src.nanosecond } }
                          Instances For
                            @[inline]

                            Creates a new PlainDateTime by adjusting the minute component of its time to the given value.

                            Equations
                            • dt.withMinutes minute = { date := dt.date, time := let __src := dt.time; { hour := __src.hour, minute := minute, second := __src.second, nanosecond := __src.nanosecond } }
                            Instances For
                              @[inline]

                              Creates a new PlainDateTime by adjusting the second component of its time to the given value.

                              Equations
                              • dt.withSeconds second = { date := dt.date, time := let __src := dt.time; { hour := __src.hour, minute := __src.minute, second := second, nanosecond := __src.nanosecond } }
                              Instances For
                                @[inline]

                                Creates a new PlainDateTime by adjusting the milliseconds component inside the nano component of its time to the given value.

                                Equations
                                • dt.withMilliseconds millis = { date := dt.date, time := dt.time.withMilliseconds millis }
                                Instances For
                                  @[inline]

                                  Creates a new PlainDateTime by adjusting the nano component of its time to the given value.

                                  Equations
                                  • dt.withNanoseconds nano = { date := dt.date, time := dt.time.withNanoseconds nano }
                                  Instances For
                                    @[inline]

                                    Adds a Day.Offset to a PlainDateTime.

                                    Equations
                                    • dt.addDays days = { date := dt.date.addDays days, time := dt.time }
                                    Instances For
                                      @[inline]

                                      Subtracts a Day.Offset from a PlainDateTime.

                                      Equations
                                      • dt.subDays days = { date := dt.date.subDays days, time := dt.time }
                                      Instances For
                                        @[inline]

                                        Adds a Week.Offset to a PlainDateTime.

                                        Equations
                                        • dt.addWeeks weeks = { date := dt.date.addWeeks weeks, time := dt.time }
                                        Instances For
                                          @[inline]

                                          Subtracts a Week.Offset from a PlainDateTime.

                                          Equations
                                          • dt.subWeeks weeks = { date := dt.date.subWeeks weeks, time := dt.time }
                                          Instances For

                                            Adds a Month.Offset to a PlainDateTime, adjusting the day to the last valid day of the resulting month.

                                            Equations
                                            • dt.addMonthsClip months = { date := dt.date.addMonthsClip months, time := dt.time }
                                            Instances For
                                              @[inline]

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

                                              Equations
                                              • dt.subMonthsClip months = { date := dt.date.subMonthsClip months, time := dt.time }
                                              Instances For

                                                Adds a Month.Offset to a PlainDateTime, rolling over excess days to the following month if needed.

                                                Equations
                                                • dt.addMonthsRollOver months = { date := dt.date.addMonthsRollOver months, time := dt.time }
                                                Instances For
                                                  @[inline]

                                                  Subtracts a Month.Offset from a PlainDateTime, adjusting the day to the last valid day of the resulting month.

                                                  Equations
                                                  • dt.subMonthsRollOver months = { date := dt.date.subMonthsRollOver months, time := dt.time }
                                                  Instances For
                                                    @[inline]

                                                    Adds a Month.Offset to a PlainDateTime, rolling over excess days to the following month if needed.

                                                    Equations
                                                    • dt.addYearsRollOver years = { date := dt.date.addYearsRollOver years, time := dt.time }
                                                    Instances For
                                                      @[inline]

                                                      Subtracts a Month.Offset from a PlainDateTime, rolling over excess days to the following month if needed.

                                                      Equations
                                                      • dt.addYearsClip years = { date := dt.date.addYearsClip years, time := dt.time }
                                                      Instances For
                                                        @[inline]

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

                                                        Equations
                                                        • dt.subYearsRollOver years = { date := dt.date.subYearsRollOver years, time := dt.time }
                                                        Instances For
                                                          @[inline]

                                                          Subtracts a Year.Offset from a PlainDateTime, adjusting the day to the last valid day of the resulting month.

                                                          Equations
                                                          • dt.subYearsClip years = { date := dt.date.subYearsClip years, time := dt.time }
                                                          Instances For
                                                            @[inline]

                                                            Adds an Hour.Offset to a PlainDateTime, adjusting the date if the hour overflows.

                                                            Equations
                                                            • dt.addHours hours = { date := dt.date.addDays (Std.Time.Internal.UnitVal.ediv (dt.time.toSeconds + hours.toSeconds) 86400), time := dt.time.addSeconds hours.toSeconds }
                                                            Instances For
                                                              @[inline]

                                                              Subtracts an Hour.Offset from a PlainDateTime, adjusting the date if the hour underflows.

                                                              Equations
                                                              • dt.subHours hours = dt.addHours (-hours)
                                                              Instances For
                                                                @[inline]

                                                                Adds a Minute.Offset to a PlainDateTime, adjusting the hour and date if the minutes overflow.

                                                                Equations
                                                                • dt.addMinutes minutes = { date := dt.date.addDays (Std.Time.Internal.UnitVal.ediv (dt.time.toSeconds + minutes.toSeconds) 86400), time := dt.time.addSeconds minutes.toSeconds }
                                                                Instances For
                                                                  @[inline]

                                                                  Subtracts a Minute.Offset from a PlainDateTime, adjusting the hour and date if the minutes underflow.

                                                                  Equations
                                                                  • dt.subMinutes minutes = dt.addMinutes (-minutes)
                                                                  Instances For
                                                                    @[inline]

                                                                    Adds a Second.Offset to a PlainDateTime, adjusting the minute, hour, and date if the seconds overflow.

                                                                    Equations
                                                                    Instances For
                                                                      @[inline]

                                                                      Subtracts a Second.Offset from a PlainDateTime, adjusting the minute, hour, and date if the seconds underflow.

                                                                      Equations
                                                                      • dt.subSeconds seconds = dt.addSeconds (-seconds)
                                                                      Instances For
                                                                        @[inline]

                                                                        Adds a Millisecond.Offset to a PlainDateTime, adjusting the second, minute, hour, and date if the milliseconds overflow.

                                                                        Equations
                                                                        • dt.addMilliseconds milliseconds = { date := dt.date.addDays (Std.Time.Internal.UnitVal.ediv (dt.time.toMilliseconds + milliseconds) 86400000), time := dt.time.addMilliseconds milliseconds }
                                                                        Instances For
                                                                          @[inline]

                                                                          Subtracts a Millisecond.Offset from a PlainDateTime, adjusting the second, minute, hour, and date if the milliseconds underflow.

                                                                          Equations
                                                                          • dt.subMilliseconds milliseconds = dt.addMilliseconds (-milliseconds)
                                                                          Instances For
                                                                            @[inline]

                                                                            Adds a Nanosecond.Offset to a PlainDateTime, adjusting the seconds, minutes, hours, and date if the nanoseconds overflow.

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

                                                                              Subtracts a Nanosecond.Offset from a PlainDateTime, adjusting the seconds, minutes, hours, and date if the nanoseconds underflow.

                                                                              Equations
                                                                              • dt.subNanoseconds nanos = dt.addNanoseconds (-nanos)
                                                                              Instances For
                                                                                @[inline]

                                                                                Getter for the Year inside of a PlainDateTime.

                                                                                Equations
                                                                                • dt.year = dt.date.year
                                                                                Instances For
                                                                                  @[inline]

                                                                                  Getter for the Month inside of a PlainDateTime.

                                                                                  Equations
                                                                                  • dt.month = dt.date.month
                                                                                  Instances For
                                                                                    @[inline]

                                                                                    Getter for the Day inside of a PlainDateTime.

                                                                                    Equations
                                                                                    • dt.day = dt.date.day
                                                                                    Instances For
                                                                                      @[inline]

                                                                                      Getter for the Weekday inside of a PlainDateTime.

                                                                                      Equations
                                                                                      • dt.weekday = dt.date.weekday
                                                                                      Instances For
                                                                                        @[inline]

                                                                                        Getter for the Hour inside of a PlainDateTime.

                                                                                        Equations
                                                                                        • dt.hour = dt.time.hour
                                                                                        Instances For
                                                                                          @[inline]

                                                                                          Getter for the Minute inside of a PlainDateTime.

                                                                                          Equations
                                                                                          • dt.minute = dt.time.minute
                                                                                          Instances For
                                                                                            @[inline]

                                                                                            Getter for the Millisecond inside of a PlainDateTime.

                                                                                            Equations
                                                                                            • dt.millisecond = dt.time.millisecond
                                                                                            Instances For
                                                                                              @[inline]

                                                                                              Getter for the Second inside of a PlainDateTime.

                                                                                              Equations
                                                                                              • dt.second = dt.time.second.snd
                                                                                              Instances For
                                                                                                @[inline]

                                                                                                Getter for the Nanosecond.Ordinal inside of a PlainDateTime.

                                                                                                Equations
                                                                                                • dt.nanosecond = dt.time.nanosecond
                                                                                                Instances For
                                                                                                  @[inline]

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

                                                                                                  Equations
                                                                                                  • date.era = date.date.era
                                                                                                  Instances For
                                                                                                    @[inline]

                                                                                                    Checks if the PlainDateTime is in a leap year.

                                                                                                    Equations
                                                                                                    • date.inLeapYear = date.year.isLeap
                                                                                                    Instances For
                                                                                                      @[inline]

                                                                                                      Determines the week of the year for the given PlainDateTime.

                                                                                                      Equations
                                                                                                      • date.weekOfYear = date.date.weekOfYear
                                                                                                      Instances For

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

                                                                                                        Equations
                                                                                                        • date.weekOfMonth = date.date.weekOfMonth
                                                                                                        Instances For
                                                                                                          @[inline]

                                                                                                          Determines the week of the month for the given PlainDateTime. The week of the month is calculated based on the day of the month and the weekday. Each week starts on Monday because the entire library is based on the Gregorian Calendar.

                                                                                                          Equations
                                                                                                          • date.alignedWeekOfMonth = date.date.alignedWeekOfMonth
                                                                                                          Instances For
                                                                                                            @[inline]

                                                                                                            Transforms a tuple of a PlainDateTime into a Day.Ordinal.OfYear.

                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              @[inline]

                                                                                                              Determines the quarter of the year for the given PlainDateTime.

                                                                                                              Equations
                                                                                                              • date.quarter = date.date.quarter
                                                                                                              Instances For
                                                                                                                @[inline]

                                                                                                                Combines a PlainTime and PlainDate into a PlainDateTime.

                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  @[inline]

                                                                                                                  Combines a PlainTime and PlainDate into a PlainDateTime.

                                                                                                                  Equations
                                                                                                                  • time.atDate date = { date := date, time := time }
                                                                                                                  Instances For