Class DateUtils

java.lang.Object
org.jruby.ext.date.DateUtils

abstract class DateUtils extends Object
  • Field Details

  • Constructor Details

    • DateUtils

      DateUtils()
  • Method Details

    • civil_to_jd

      static long civil_to_jd(int y, int m, int d, double sg)
      Convert a Civil Date to a Julian Day Number. +y+, +m+, and +d+ are the year, month, and day of the month.
      Parameters:
      y -
      m -
      d -
      sg - specifies the Day of Calendar Reform
      Returns:
      the corresponding Julian Day Number
    • jd_to_civil

      static int[] jd_to_civil(long jd, double sg)
      Convert a Julian Day Number to a Civil Date. +jd+ is the Julian Day Number. +sg+ specifies the Day of Calendar Reform.
      Parameters:
      jd -
      sg - specifies the Day of Calendar Reform
      Returns:
      the corresponding [year, month, day_of_month] as a three-element array.
    • ordinal_to_jd

      static long ordinal_to_jd(int y, int d, long sg)
      Convert an Ordinal Date to a Julian Day Number. +y+ and +d+ are the year and day-of-year to convert. +sg+ specifies the Day of Calendar Reform. Returns the corresponding Julian Day Number.
    • jd_to_ordinal

      static int[] jd_to_ordinal(long jd, double sg)
      Convert a Julian Day Number to an Ordinal Date. +jd+ is the Julian Day Number to convert. +sg+ specifies the Day of Calendar Reform. Returns the corresponding Ordinal Date as [year, day_of_year]
    • commercial_to_jd

      static long commercial_to_jd(int y, int w, int d, long sg)
      # Convert a Commercial Date to a Julian Day Number. # # +y+, +w+, and +d+ are the (commercial) year, week of the year, # and day of the week of the Commercial Date to convert. # +sg+ specifies the Day of Calendar Reform.
    • jd_to_commercial

      static int[] jd_to_commercial(long jd, long sg)
      # Convert a Julian Day Number to a Commercial Date # # +jd+ is the Julian Day Number to convert. # +sg+ specifies the Day of Calendar Reform. # # Returns the corresponding Commercial Date as # [commercial_year, week_of_year, day_of_week]
    • weeknum_to_jd

      private static long weeknum_to_jd(int y, int w, int d, int f, long sg)
    • jd_to_weeknum

      private static int[] jd_to_weeknum(long jd, int f, long sg)
    • nth_kday_to_jd

      private static long nth_kday_to_jd(int y, int m, int n, int k, long sg)
    • jd_to_nth_kday

      private static int[] jd_to_nth_kday(long jd, long sg)
    • valid_time_p

      static boolean valid_time_p(long h, long min, long s)
    • day_to_sec

      static IRubyObject day_to_sec(ThreadContext context, IRubyObject d)
    • offset_to_sec

      static int offset_to_sec(ThreadContext context, IRubyObject of)
    • find_ldom

      static Long find_ldom(int y, int m, long sg)
    • find_fdom

      static Long find_fdom(int y, int m, long sg)
    • find_fdoy

      static Long find_fdoy(int y, long sg)
    • find_ldoy

      static Long find_ldoy(int y, long sg)
    • _valid_civil_p

      static Long _valid_civil_p(int y, int m, int d, long sg)
    • _valid_ordinal_p

      static Long _valid_ordinal_p(int y, int d, long sg)
    • _valid_commercial_p

      static Long _valid_commercial_p(int y, int w, int d, long sg)
    • _valid_weeknum_p

      static Long _valid_weeknum_p(int y, int w, int d, int f, long sg)
    • _valid_nth_kday_p

      static Long _valid_nth_kday_p(int y, int m, int n, int k, long sg)
    • decode_year

      static int decode_year(ThreadContext context, IRubyObject y, int style, RubyInteger[] nth)
    • guess_style

      static long guess_style(ThreadContext context, IRubyObject y, double sg)
    • sites

      private static JavaSites.DateSites sites(ThreadContext context)