Documentation

Std.Time.Date.Unit.Year

Defines the different eras.

  • bce : Std.Time.Year.Era

    The era before the Common Era (BCE), always represents a date before year 0.

  • ce : Std.Time.Year.Era

    The Common Era (CE), represents dates from year 0 onwards.

Instances For

    Offset represents a year offset, defined as an Int.

    Equations
    Instances For
      Equations
      Equations
      Equations
      • Std.Time.Year.instOfNatOffset = { ofNat := Int.ofNat n }
      @[inline]

      Creates an Offset from a natural number.

      Equations
      Instances For
        @[inline]

        Creates an Offset from an integer.

        Equations
        Instances For
          @[inline]

          Converts the Year offset to an Int.

          Equations
          • offset.toInt = offset
          Instances For
            @[inline]

            Converts the Year offset to a Month offset.

            Equations
            Instances For
              @[inline]

              Determines if a year is a leap year in the proleptic Gregorian calendar.

              Equations
              • y.isLeap = decide (y.toInt.tmod 4 = 0 (y.toInt.tmod 100 0 y.toInt.tmod 400 = 0))
              Instances For

                Returns the Era of the Year.

                Equations
                Instances For

                  Calculates the number of days in the specified year.

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

                    Calculates the number of weeks in the specified year.

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

                      Checks if the given date is valid for the specified year, month, and day.

                      Equations
                      Instances For