Package org.jruby.ext.date
Class DateUtils
java.lang.Object
org.jruby.ext.date.DateUtils
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate static final intprivate static final intprivate static final intprivate static final int(package private) static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Long_valid_civil_p(int y, int m, int d, long sg) (package private) static Long_valid_commercial_p(int y, int w, int d, long sg) (package private) static Long_valid_nth_kday_p(int y, int m, int n, int k, long sg) (package private) static Long_valid_ordinal_p(int y, int d, long sg) (package private) static Long_valid_weeknum_p(int y, int w, int d, int f, long sg) (package private) static longcivil_to_jd(int y, int m, int d, double sg) Convert a Civil Date to a Julian Day Number.(package private) static longcommercial_to_jd(int y, int w, int d, long sg) # Convert a Commercial Date to a Julian Day Number.(package private) static IRubyObjectday_to_sec(ThreadContext context, IRubyObject d) (package private) static intdecode_year(ThreadContext context, IRubyObject y, int style, RubyInteger[] nth) (package private) static Longfind_fdom(int y, int m, long sg) (package private) static Longfind_fdoy(int y, long sg) (package private) static Longfind_ldom(int y, int m, long sg) (package private) static Longfind_ldoy(int y, long sg) (package private) static longguess_style(ThreadContext context, IRubyObject y, double sg) (package private) static int[]jd_to_civil(long jd, double sg) Convert a Julian Day Number to a Civil Date.(package private) 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.private static int[]jd_to_nth_kday(long jd, long sg) (package private) static int[]jd_to_ordinal(long jd, double sg) Convert a Julian Day Number to an Ordinal Date.private static int[]jd_to_weeknum(long jd, int f, long sg) private static longnth_kday_to_jd(int y, int m, int n, int k, long sg) (package private) static intoffset_to_sec(ThreadContext context, IRubyObject of) (package private) static longordinal_to_jd(int y, int d, long sg) Convert an Ordinal Date to a Julian Day Number.private static JavaSites.DateSitessites(ThreadContext context) (package private) static booleanvalid_time_p(long h, long min, long s) private static longweeknum_to_jd(int y, int w, int d, int f, long sg)
-
Field Details
-
INVALID_OFFSET
static final int INVALID_OFFSET- See Also:
-
JC_PERIOD0
private static final int JC_PERIOD0- See Also:
-
GC_PERIOD0
private static final int GC_PERIOD0- See Also:
-
CM_PERIOD0
private static final int CM_PERIOD0- See Also:
-
CM_PERIOD
static final int CM_PERIOD- See Also:
-
CM_PERIOD_JCY
private static final int CM_PERIOD_JCY- See Also:
-
CM_PERIOD_GCY
private static final int CM_PERIOD_GCY- See Also:
-
-
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
-
offset_to_sec
-
find_ldom
-
find_fdom
-
find_fdoy
-
find_ldoy
-
_valid_civil_p
-
_valid_ordinal_p
-
_valid_commercial_p
-
_valid_weeknum_p
-
_valid_nth_kday_p
-
decode_year
-
guess_style
-
sites
-