Package org.jruby.ext.date
Class RubyDate
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.ext.date.RubyDate
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
- Direct Known Subclasses:
RubyDateTime
JRuby's
Date implementation - 'native' parts.
In MRI, since 2.x, all of date.rb has been moved to native (C) code.
NOTE: There's still date.rb, where this gets bootstrapped from.- Since:
- 9.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteListprivate static final ByteList[]private static final ByteList[](package private) static final org.joda.time.chrono.GJChronology(package private) static final int(package private) static final intprivate RubyFixnumprivate static final Stringprivate static final ByteList(package private) static final org.joda.time.DateTime(package private) org.joda.time.DateTime(package private) static final int(package private) static final longprivate static final doubleprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final int(package private) static final int(package private) static final longprivate static final doubleprivate static final int(package private) static final Loggerprivate static final intprivate static final int(package private) intprivate static final int(package private) static final intprivate static final int(package private) static final intprivate static final ByteList(package private) long(package private) static final int(package private) long(package private) longprivate static final ByteListprivate static final ByteListFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected(package private)(package private)RubyDate(Ruby runtime, RubyClass klass, org.joda.time.DateTime dt, int off, long start, long subMillisNum, long subMillisDen) (package private)RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, int off, long start) (package private)RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, long[] rest, int off, long start) (package private)RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, org.joda.time.Chronology chronology, int off) privateRubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, org.joda.time.Chronology chronology, int off, long start) -
Method Summary
Modifier and TypeMethodDescriptionstatic RubyInteger_comp_year69(ThreadContext context, IRubyObject self, IRubyObject year) static RubyInteger_i(ThreadContext context, IRubyObject self, IRubyObject val) static RubyDate_load(ThreadContext context, IRubyObject klass, IRubyObject str) static IRubyObject_match(ThreadContext context, IRubyObject self, IRubyObject reg, IRubyObject str) (package private) static IRubyObject_parse_day(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) static IRubyObject_parse_ddd(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) (package private) static IRubyObject_parse_dot(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static IRubyObject_parse_eu(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) static IRubyObject_parse_impl(ThreadContext context, IRubyObject self, IRubyObject s, IRubyObject h) (package private) static IRubyObject_parse_iso(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) static IRubyObject_parse_iso2(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) static IRubyObject_parse_jis(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) (package private) static IRubyObject_parse_mday(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static IRubyObject_parse_mon(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static IRubyObject_parse_sla(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static IRubyObject_parse_time(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static IRubyObject_parse_us(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) static IRubyObject_parse_vms(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) (package private) static IRubyObject_parse_year(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) static IRubyObject_s3e(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObject_strptime(ThreadContext context, IRubyObject self, IRubyObject string) static IRubyObject_strptime(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObject_strptime(ThreadContext context, IRubyObject self, IRubyObject string, IRubyObject format) static IRubyObject_subs(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject reg) _valid_civil_p(ThreadContext context, IRubyObject[] args) Deprecated.static IRubyObject_valid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObject_valid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated.static IRubyObject_valid_jd_p(IRubyObject self, IRubyObject jd) static IRubyObject_valid_jd_p(IRubyObject self, IRubyObject jd, IRubyObject sg) _valid_ordinal_p(ThreadContext context, IRubyObject[] args) Deprecated.static IRubyObject_valid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated.static IRubyObject_valid_time_p(ThreadContext context, IRubyObject self, IRubyObject h, IRubyObject m, IRubyObject s) static IRubyObject_valid_weeknum_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated.(package private) final intadjustJodaYear(int year) private voidadjustWithDayFraction(ThreadContext context, org.joda.time.DateTime dt, long[] rest) ajd(ThreadContext context) amjd(ThreadContext context) private static voidprivate static intstatic RubyDatecivil(ThreadContext context, IRubyObject self) # Create a new Date object for the Civil Date specified by # year +y+, month +m+, and day-of-month +d+.static RubyDatecivil(ThreadContext context, IRubyObject self, IRubyObject year) static RubyDatecivil(ThreadContext context, IRubyObject self, IRubyObject[] args) static RubyDatecivil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month) static RubyDatecivil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month, IRubyObject mday) static org.joda.time.DateTimecivilDate(ThreadContext context, int y, int m, int d, org.joda.time.Chronology chronology) private static RubyDatecivilImpl(ThreadContext context, RubyClass klass, IRubyObject year, IRubyObject month, IRubyObject mday, long sg) (package private) static org.joda.time.DateTimecivilImpl(ThreadContext context, IRubyObject year) (package private) static org.joda.time.DateTimecivilImpl(ThreadContext context, IRubyObject year, IRubyObject month) private intcmp(ThreadContext context, RubyDate that) private intcmpSubMillis(ThreadContext context, RubyDate that) static RubyDatecommercial(ThreadContext context, IRubyObject self, IRubyObject[] args) (package private) static RubyClasscreateDateClass(Ruby runtime) private static RubyIntegercstr2num(Ruby runtime, RubyString str, int bp, int ep) cwday(ThreadContext context) cweek(ThreadContext context) cwyear(ThreadContext context) day_fraction(ThreadContext context) private RubyFixnumDAY_MS(ThreadContext context) private static int(package private) static voiddebug(ThreadContext context, String msg, Exception ex) private static voiddo_parse(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash, int flags) england(ThreadContext context) eql_p(IRubyObject other) rb_obj_equal Just like "==" and "equal?", "eql?" will use identity equality for Object.booleanThis override does not do a "checked" dispatch.final booleanprivate IRubyObjectfallback_cmp(ThreadContext context, IRubyObject other) private IRubyObjectfallback_eqq(ThreadContext context, IRubyObject other) (package private) static RubyStringformat(ThreadContext context, ByteList fmt, IRubyObject... args) static org.joda.time.ChronologygetChronology(ThreadContext context, long sg, int off) (package private) static org.joda.time.ChronologygetChronology(ThreadContext context, long sg, org.joda.time.DateTimeZone zone) (package private) static RubyClassorg.joda.time.DateTime(package private) static RubyClassgetDateTime(Ruby runtime) intgetDay()intgetHour()Will return the Java interface that most closely can represent this object, when working through Java integration translations.final longintintgetMonth()(package private) static intgetMonth(IRubyObject month) intgetNanos()int(package private) static longgetValidStart(ThreadContext context, double sg, int DEFAULT_SG) intgetYear()(package private) static intgetYear(IRubyObject year) gregorian(ThreadContext context) static IRubyObjectgregorian_leap_p(ThreadContext context, IRubyObject self, IRubyObject year) gregorian_p(ThreadContext context) hash()rb_obj_id Will return the hash code of this object.hash(ThreadContext context) inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.private static IRubyObjecthashGet(ThreadContext context, RubyHash hash, String key) private static booleanhashGetTest(ThreadContext context, RubyHash hash, String key) private RubyFixnumhour(ThreadContext context) initialize(ThreadContext context, IRubyObject dt) Deprecated.kept due AR-JDBC (uses RubyClass.newInstance(...) to 'fast' allocate a Date instance)initialize(ThreadContext context, IRubyObject ajd, IRubyObject of) private voidinitialize(ThreadContext context, IRubyObject arg, IRubyObject of, long start) initialize(ThreadContext context, IRubyObject ajd, IRubyObject of, IRubyObject sg) initialize_copy(IRubyObject original) rb_obj_init_copy Initializes this object as a copy of the original, that is the parameter to this object.private longinitMillis(ThreadContext context, IRubyObject ajd) final IRubyObjectinspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.inspect(ThreadContext context) private static booleanisAlpha(char c) private static booleanisDigit(char c) private static booleanisGregorianLeap(long year) final booleanisJulian()private static booleanisJulianLeap(long year) italy(ThreadContext context) jd(ThreadContext context) static RubyDatejd(ThreadContext context, IRubyObject self) Create a new Date object from a Julian Day Number.static RubyDatejd(ThreadContext context, IRubyObject self, IRubyObject jd) static RubyDatejd(ThreadContext context, IRubyObject self, IRubyObject jd, IRubyObject sg) private static doublejd_to_ajd(long jd) (package private) static RubyNumericjd_to_ajd(ThreadContext context, long jd) (package private) static RubyNumericjd_to_ajd(ThreadContext context, long jd, RubyNumeric fr, int of_sec) (package private) static RubyNumericjd_to_ajd(ThreadContext context, RubyNumeric jd, RubyNumeric fr, int of_sec) static RubyNumericjd_to_ajd(ThreadContext context, IRubyObject self, IRubyObject[] args) private static RubyDatejdImpl(ThreadContext context, IRubyObject self, IRubyObject jd, long sg) julian(ThreadContext context) static IRubyObjectjulian_leap_p(ThreadContext context, IRubyObject self, IRubyObject year) julian_p(ThreadContext context) ld(ThreadContext context) leap_p(ThreadContext context) marshal_dump(ThreadContext context) marshal_load(ThreadContext context, IRubyObject a) private IRubyObjectmarshal_load_6(ThreadContext context, IRubyObject jd, IRubyObject df, IRubyObject sf) private static RubyStringmatchOrNull(ThreadContext context, RubyMatchData match, int i) mday(ThreadContext context) minute(ThreadContext context) mjd(ThreadContext context) mon(ThreadContext context) private static intstatic RubyDatenew_(ThreadContext context, IRubyObject self) Deprecated.internal Date.new!static RubyDatenew_(ThreadContext context, IRubyObject self, IRubyObject ajd) Deprecated.internal Date.new!static RubyDatenew_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of) Deprecated.internal Date.new!static RubyDatenew_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of, IRubyObject sg) Deprecated.internal Date.new!new_offset(ThreadContext context, IRubyObject[] args) new_start(ThreadContext context) new_start(ThreadContext context, IRubyObject sg) (package private) final RubyDatenewInstance(ThreadContext context, org.joda.time.DateTime dt, int off, long start) (package private) RubyDatenewInstance(ThreadContext context, org.joda.time.DateTime dt, int off, long start, long subNum, long subDen) (package private) static RubyRationalnewRationalConvert(ThreadContext context, IRubyObject num, long den) private static RubyRegexpnewRegexpFromCache(Ruby runtime, ByteList str, int opts) private RubyDatenewStart(ThreadContext context, long start) next(ThreadContext context) next_day(ThreadContext context) next_day(ThreadContext context, IRubyObject n) next_month(ThreadContext context) next_month(ThreadContext context, IRubyObject n) next_year(ThreadContext context) next_year(ThreadContext context, IRubyObject n) (package private) final RubyDateprivate static longnormIntValue(IRubyObject val, int negOffset) private static ByteListof2str(int of) offset(ThreadContext context) op_cmp(ThreadContext context, IRubyObject other) op_eqq(ThreadContext context, IRubyObject other) The relationship operator for Date.op_minus(ThreadContext context, IRubyObject n) private RubyNumericop_minus_date(ThreadContext context, RubyDate that) op_plus(ThreadContext context, IRubyObject n) (package private) RubyDateop_plus_numeric(ThreadContext context, RubyNumeric n) static RubyDateordinal(ThreadContext context, IRubyObject self, IRubyObject[] args) (package private) static IRubyObjectparse(ThreadContext context, IRubyObject string, String format) (package private) static voidparse_bc(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) (package private) static voidparse_frag(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) private static IRubyObjectparse_sla_dot(ThreadContext context, ByteList pattern, RubyString str, RubyHash hash) prev_day(ThreadContext context) prev_day(ThreadContext context, IRubyObject n) prev_month(ThreadContext context) prev_month(ThreadContext context, IRubyObject n) prev_year(ThreadContext context) prev_year(ThreadContext context, IRubyObject n) private RubyDateprevNextYear(ThreadContext context, IRubyObject n, boolean negate) (package private) static RubyNumericroundToPrecision(ThreadContext context, RubyFloat sub, long precision) private static IRubyObjects3e(ThreadContext context, RubyHash hash, RubyString y, RubyString m, RubyString d, boolean bc) sec_fraction(ThreadContext context) second(ThreadContext context) private static voidset_hash(ThreadContext context, RubyHash hash, String key, IRubyObject val) shift_bw(ThreadContext context, IRubyObject n) shift_fw(ThreadContext context, IRubyObject n) private static intprivate static intskipDigits(RubyString str, int off) private static intstart(ThreadContext context) strftime(ThreadContext context) strftime(ThreadContext context, IRubyObject fmt) private static booleanstrPtr(RubyString str, char c) (package private) final RubyRationalprivate RubyNumericsubMillisDiff(ThreadContext context, RubyDate that) private static IRubyObjectsubSpace(ThreadContext context, RubyString str, RubyRegexp reg) (package private) static longtimesIntDiff(ThreadContext context, IRubyObject n, int times) (package private) static RubyNumerictimeToDayFraction(ThreadContext context, int hour, int min, int sec) to_date()to_datetime(ThreadContext context) final IRubyObjectto_s()rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj.to_s(ThreadContext context) to_time(ThreadContext context) toDate()static RubyDatetoday(ThreadContext context, IRubyObject self) # Create a new Date object representing today.static RubyDatetoday(ThreadContext context, IRubyObject self, IRubyObject sg) private static org.joda.time.DateTimetodayDate(ThreadContext context, org.joda.time.Chronology chrono) <T> TConvert the object to the specified Java class, if possible.(package private) static intval2off(ThreadContext context, IRubyObject of) (package private) static longval2sg(ThreadContext context, IRubyObject sg) static IRubyObjectvalid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObjectvalid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObjectvalid_jd_p(ThreadContext context, IRubyObject self, IRubyObject jd) static IRubyObjectvalid_jd_p(ThreadContext context, IRubyObject self, IRubyObject jd, IRubyObject sg) static IRubyObjectvalid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args) (package private) static longvalid_sg(ThreadContext context, IRubyObject sg) (package private) static LongvalidCivilImpl(IRubyObject year, IRubyObject month, IRubyObject day, long sg) (package private) static LongvalidCommercialImpl(IRubyObject year, IRubyObject week, IRubyObject day, long sg) private static LongvalidOrdinalImpl(IRubyObject year, int day, long sg) (package private) static LongvalidOrdinalImpl(IRubyObject year, IRubyObject day, long sg) private static IRubyObjectvalMinusOneHalf(ThreadContext context, IRubyObject val) wday(ThreadContext context) yday(ThreadContext context) year(ThreadContext context) zone(ThreadContext context) static IRubyObjectzone_to_diff(ThreadContext context, IRubyObject self, IRubyObject zone) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, getNativeClassIndex, inspect, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, ensureInstanceVariablesSettable, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_equal, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
LOG
-
CHRONO_ITALY_UTC
static final org.joda.time.chrono.GJChronology CHRONO_ITALY_UTC -
ITALY
static final int ITALY- See Also:
-
ENGLAND
static final int ENGLAND- See Also:
-
JULIAN_INFINITY
private static final double JULIAN_INFINITY- See Also:
-
JULIAN
static final long JULIAN- See Also:
-
GREGORIAN_INFINITY
private static final double GREGORIAN_INFINITY- See Also:
-
GREGORIAN
static final long GREGORIAN- See Also:
-
REFORM_BEGIN_YEAR
static final int REFORM_BEGIN_YEAR- See Also:
-
REFORM_END_YEAR
static final int REFORM_END_YEAR- See Also:
-
dt
org.joda.time.DateTime dt -
off
int off -
start
long start -
subMillisNum
long subMillisNum -
subMillisDen
long subMillisDen -
defaultDateTime
static final org.joda.time.DateTime defaultDateTime -
DAY_IN_SECONDS
static final int DAY_IN_SECONDS- See Also:
-
DAY_MS
static final int DAY_MS- See Also:
-
DAY_MS_CACHE
-
UTC_ZONE
-
HOUR_IN_SECONDS
private static final int HOUR_IN_SECONDS- See Also:
-
MINUTE_IN_SECONDS
private static final int MINUTE_IN_SECONDS- See Also:
-
MJD_EPOCH_IN_CJD
private static final int MJD_EPOCH_IN_CJD- See Also:
-
LD_EPOCH_IN_CJD
private static final int LD_EPOCH_IN_CJD- See Also:
-
SUB_MS_PRECISION
static final int SUB_MS_PRECISION- See Also:
-
REFORM_BEGIN_JD
private static final int REFORM_BEGIN_JD- See Also:
-
REFORM_END_JD
private static final int REFORM_END_JD- See Also:
-
TO_S_FORMAT
-
DEFAULT_FORMAT
- See Also:
-
DEFAULT_FORMAT_BYTES
-
ABBR_DAYS
-
_parse_time
-
_parse_time2
-
ABBR_MONTHS
-
_parse_day
-
_parse_mon
-
_parse_year
-
_parse_mday
-
_parse_eu
-
_parse_us
-
_parse_iso
-
_parse_sla
-
_parse_dot
-
_parse_bc
-
_parse_frag
-
SPACE
-
_parse_impl
-
HAVE_ALPHA
private static final int HAVE_ALPHA- See Also:
-
HAVE_DIGIT
private static final int HAVE_DIGIT- See Also:
-
HAVE_DASH
private static final int HAVE_DASH- See Also:
-
HAVE_DOT
private static final int HAVE_DOT- See Also:
-
HAVE_SLASH
private static final int HAVE_SLASH- See Also:
-
HAVE_COLON
private static final int HAVE_COLON- See Also:
-
HAVE_M_m
private static final int HAVE_M_m- See Also:
-
HAVE_H_h
private static final int HAVE_H_h- See Also:
-
HAVE_S_s
private static final int HAVE_S_s- See Also:
-
HAVE_B_b
private static final int HAVE_B_b- See Also:
-
-
Constructor Details
-
RubyDate
-
RubyDate
-
RubyDate
-
RubyDate
-
RubyDate
-
RubyDate
-
RubyDate
RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, org.joda.time.Chronology chronology, int off) -
RubyDate
RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, int off, long start) -
RubyDate
RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, long[] rest, int off, long start) -
RubyDate
private RubyDate(ThreadContext context, RubyClass klass, IRubyObject ajd, org.joda.time.Chronology chronology, int off, long start)
-
-
Method Details
-
createDateClass
-
getDate
-
getDateTime
-
newInstance
-
newInstance
RubyDate newInstance(ThreadContext context, org.joda.time.DateTime dt, int off, long start, long subNum, long subDen) -
initialize
Deprecated.kept due AR-JDBC (uses RubyClass.newInstance(...) to 'fast' allocate a Date instance) -
initialize
-
initialize
-
initialize
-
initMillis
-
DAY_MS
-
initialize_copy
Description copied from class:RubyBasicObjectrb_obj_init_copy Initializes this object as a copy of the original, that is the parameter to this object. Will make sure that the argument actually has the same real class as this object. It shouldn't be possible to initialize an object with something totally different.- Overrides:
initialize_copyin classRubyBasicObject
-
new_
Deprecated.internal Date.new! -
new_
Deprecated.internal Date.new! -
new_
public static RubyDate new_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of) Deprecated.internal Date.new! -
new_
public static RubyDate new_(ThreadContext context, IRubyObject self, IRubyObject ajd, IRubyObject of, IRubyObject sg) Deprecated.internal Date.new! -
civil
# Create a new Date object for the Civil Date specified by # year +y+, month +m+, and day-of-month +d+. # # +m+ and +d+ can be negative, in which case they count # backwards from the end of the year and the end of the # month respectively. No wraparound is performed, however, # and invalid values cause an ArgumentError to be raised. # can be negative # # +y+ defaults to -4712, +m+ to 1, and +d+ to 1; this is # Julian Day Number day 0. # # +sg+ specifies the Day of Calendar Reform. -
civil
-
civilImpl
-
civil
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month) -
civilImpl
-
civil
public static RubyDate civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month, IRubyObject mday) -
civilImpl
private static RubyDate civilImpl(ThreadContext context, RubyClass klass, IRubyObject year, IRubyObject month, IRubyObject mday, long sg) -
civil
-
civilDate
public static org.joda.time.DateTime civilDate(ThreadContext context, int y, int m, int d, org.joda.time.Chronology chronology) -
getYear
-
getMonth
-
valid_civil_p
public static IRubyObject valid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args) -
validCivilImpl
-
_valid_time_p
public static IRubyObject _valid_time_p(ThreadContext context, IRubyObject self, IRubyObject h, IRubyObject m, IRubyObject s) -
normIntValue
-
timeToDayFraction
-
jd
Create a new Date object from a Julian Day Number. +jd+ is the Julian Day Number; if not specified, it defaults to 0. +sg+ specifies the Day of Calendar Reform. -
jd
-
jd
-
jdImpl
-
adjustWithDayFraction
-
normalizeSubMillis
-
valid_jd_p
-
valid_jd_p
public static IRubyObject valid_jd_p(ThreadContext context, IRubyObject self, IRubyObject jd, IRubyObject sg) -
_valid_jd_p
-
_valid_jd_p
-
ordinal
-
valid_ordinal_p
public static IRubyObject valid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args) -
validOrdinalImpl
-
validOrdinalImpl
-
_valid_ordinal_p
@Deprecated public static IRubyObject _valid_ordinal_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated. -
_valid_ordinal_p
Deprecated. -
commercial
-
valid_commercial_p
public static IRubyObject valid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args) -
validCommercialImpl
-
_valid_commercial_p
@Deprecated public static IRubyObject _valid_commercial_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated. -
_valid_weeknum_p
@Deprecated public static IRubyObject _valid_weeknum_p(ThreadContext context, IRubyObject self, IRubyObject[] args) Deprecated. -
today
# Create a new Date object representing today. # # +sg+ specifies the Day of Calendar Reform. -
today
-
todayDate
private static org.joda.time.DateTime todayDate(ThreadContext context, org.joda.time.Chronology chrono) -
_valid_civil_p
public static IRubyObject _valid_civil_p(ThreadContext context, IRubyObject self, IRubyObject[] args) -
_valid_civil_p
Deprecated. -
getDateTime
public org.joda.time.DateTime getDateTime() -
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classRubyObject- See Also:
-
equals
-
eql_p
Description copied from class:RubyBasicObjectrb_obj_equal Just like "==" and "equal?", "eql?" will use identity equality for Object.- Overrides:
eql_pin classRubyBasicObject
-
op_eqq
The relationship operator for Date. Compares dates by Julian Day Number. When comparing two DateTime instances, or a DateTime with a Date, the instances will be regarded as equivalent if they fall on the same date in local time.- Specified by:
op_eqqin interfaceIRubyObject- Overrides:
op_eqqin classRubyObject- Parameters:
context-other-- Returns:
- true/false/nil
-
fallback_eqq
-
op_cmp
- Overrides:
op_cmpin classRubyBasicObject
-
cmp
-
cmpSubMillis
-
fallback_cmp
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- See Also:
-
hash
-
hashImpl
-
hash
Description copied from class:RubyBasicObjectrb_obj_id Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.- Overrides:
hashin classRubyBasicObject
-
jd
-
getJulianDayNumber
public final long getJulianDayNumber() -
julian_p
-
gregorian_p
-
isJulian
public final boolean isJulian() -
ajd
-
amjd
-
start
-
adjustJodaYear
final int adjustJodaYear(int year) -
year
-
yday
-
mon
-
mday
-
day_fraction
-
hour
-
minute
-
second
-
sec_fraction
-
cwyear
-
cweek
-
cwday
-
wday
-
zone
-
of2str
-
append
-
mjd
-
ld
-
offset
-
new_offset
-
new_start
-
new_start
-
newStart
-
italy
-
england
-
julian
-
gregorian
-
julian_leap_p
-
gregorian_leap_p
public static IRubyObject gregorian_leap_p(ThreadContext context, IRubyObject self, IRubyObject year) -
isJulianLeap
private static boolean isJulianLeap(long year) -
isGregorianLeap
private static boolean isGregorianLeap(long year) -
leap_p
-
op_plus
-
op_plus_numeric
-
roundToPrecision
-
op_minus
-
op_minus_date
-
subMillisDiff
-
subMillis
-
next
-
next_day
-
next_day
-
prev_day
-
prev_day
-
next_month
-
next_month
-
prev_month
-
prev_month
-
simpleIntDiff
-
shift_fw
-
shift_bw
-
next_year
-
next_year
-
prev_year
-
prev_year
-
prevNextYear
-
timesIntDiff
-
marshal_dump
-
_load
-
marshal_load
-
marshal_load_6
private IRubyObject marshal_load_6(ThreadContext context, IRubyObject jd, IRubyObject df, IRubyObject sf) -
valMinusOneHalf
-
newRationalConvert
-
jd_to_ajd
private static double jd_to_ajd(long jd) -
jd_to_ajd
-
jd_to_ajd
-
jd_to_ajd
-
jd_to_ajd
-
getChronology
-
getChronology
static org.joda.time.Chronology getChronology(ThreadContext context, long sg, org.joda.time.DateTimeZone zone) -
val2sg
-
valid_sg
-
getValidStart
-
val2off
-
debug
-
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
inspect
-
to_s
Description copied from class:RubyBasicObjectrb_any_to_s call-seq: obj.to_s => string Returns a string representing obj. The defaultto_sprints the object's class and an encoding of the object id. As a special case, the top-level object that is the initial execution context of Ruby programs returns ``main.''- Overrides:
to_sin classRubyBasicObject
-
to_s
-
format
-
to_date
-
to_datetime
-
to_time
-
strftime
-
strftime
-
_strptime
-
_strptime
public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject string, IRubyObject format) -
parse
-
_strptime
-
zone_to_diff
-
_i
-
_comp_year69
-
day_num
-
_parse_time
static IRubyObject _parse_time(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
mon_num
-
_parse_day
static IRubyObject _parse_day(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_mon
static IRubyObject _parse_mon(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_year
static IRubyObject _parse_year(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_mday
static IRubyObject _parse_mday(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_eu
static IRubyObject _parse_eu(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_us
static IRubyObject _parse_us(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
newRegexpFromCache
-
matchOrNull
-
_parse_iso
static IRubyObject _parse_iso(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_sla
static IRubyObject _parse_sla(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
_parse_dot
static IRubyObject _parse_dot(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) -
parse_sla_dot
private static IRubyObject parse_sla_dot(ThreadContext context, ByteList pattern, RubyString str, RubyHash hash) -
parse_bc
-
parse_frag
-
hashGet
-
hashGetTest
-
subSpace
-
_parse_jis
public static IRubyObject _parse_jis(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) -
_parse_vms
public static IRubyObject _parse_vms(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) -
_parse_iso2
public static IRubyObject _parse_iso2(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) -
_parse_ddd
public static IRubyObject _parse_ddd(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject h) -
_parse_impl
public static IRubyObject _parse_impl(ThreadContext context, IRubyObject self, IRubyObject s, IRubyObject h) -
do_parse
private static void do_parse(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash, int flags) -
check_class
-
_subs
public static IRubyObject _subs(ThreadContext context, IRubyObject self, IRubyObject str, IRubyObject reg) -
_match
public static IRubyObject _match(ThreadContext context, IRubyObject self, IRubyObject reg, IRubyObject str) -
_s3e
-
s3e
private static IRubyObject s3e(ThreadContext context, RubyHash hash, RubyString y, RubyString m, RubyString d, boolean bc) -
set_hash
-
cstr2num
-
strPtr
-
isDigit
private static boolean isDigit(char c) -
isAlpha
private static boolean isAlpha(char c) -
skipNonDigitsAndSign
-
skipDigits
-
getYear
public int getYear()- Returns:
- year
-
getMonth
public int getMonth()- Returns:
- month-of-year (1..12)
-
getDay
public int getDay()- Returns:
- day-of-month
-
getHour
public int getHour()- Returns:
- hour-of-day (0..23)
-
getMinute
public int getMinute()- Returns:
- minute-of-hour
-
getSecond
public int getSecond()- Returns:
- second-of-minute
-
getNanos
public int getNanos()- Returns:
- the nano second part (only) of time
-
toDate
-
toInstant
- Returns:
- an instant
-
toLocalDate
- Returns:
- a (local) date
-
getJavaClass
Description copied from class:RubyBasicObjectWill return the Java interface that most closely can represent this object, when working through Java integration translations.- Specified by:
getJavaClassin interfaceIRubyObject- Overrides:
getJavaClassin classRubyBasicObject- Returns:
- the true Java class of this (Ruby) object
-
toJava
Description copied from interface:IRubyObjectConvert the object to the specified Java class, if possible.- Specified by:
toJavain interfaceIRubyObject- Overrides:
toJavain classRubyBasicObject- Parameters:
target- The target type to which the object should be converted.- See Also:
-