Package org.jruby
Class RubyTime
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyTime
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
The Time class.
- 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 org.joda.time.DateTimeprivate booleanprivate longprivate static final BigDecimalprivate static final org.joda.time.format.DateTimeFormatterprivate static final BigDecimalprivate static final Patternstatic final intprivate static final org.joda.time.DateTimeprivate static final org.joda.time.format.DateTimeFormatterprivate static final org.joda.time.format.DateTimeFormatterprivate static final org.joda.time.format.DateTimeFormatterprivate static final Patternprivate static final ByteListstatic final Stringprivate IRubyObjectFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RubyTimeadjustTimeZone(Ruby runtime, org.joda.time.DateTimeZone zone, boolean isTzRelative) private static RubyTimeallocateInstance(RubyClass recv) asctime()static IRubyObjectat(ThreadContext context, IRubyObject recv, IRubyObject arg) static IRubyObjectat(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectat(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) static IRubyObjectat(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) private static RubyTimeat1(ThreadContext context, IRubyObject recv, IRubyObject arg) private static RubyTimeatMulti(ThreadContext context, RubyClass recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject zone) private static IRubyObjectatOpts(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject opts) private intstatic doubleconvertTimeInterval(ThreadContext context, IRubyObject sec) static RubyClasscreateTimeClass(Ruby runtime) dump(IRubyObject[] args, Block unusedBlock) Deprecated.dump(ThreadContext context) dump(ThreadContext context, IRubyObject arg) eql_p(IRubyObject other) rb_obj_equal Just like "==" and "equal?", "eql?" will use identity equality for Object.private static longextractTime(ThreadContext context, IRubyObject time) private IRubyObjectfindTimezone(ThreadContext context, IRubyObject zone) friday_p(ThreadContext context) org.joda.time.DateTimeintgetDay()static StringgetEnvTimeZone(Ruby runtime) getgm()intgetHour()Class<?>Will return the Java interface that most closely can represent this object, when working through Java integration translations.final RubyTimegetlocal()getlocal(ThreadContext context) getlocal(ThreadContext context, IRubyObject off) getlocal19(ThreadContext context, IRubyObject[] args) Deprecated.static org.joda.time.DateTimeZonegetLocalTimeZone(Ruby runtime) intReturn the micro-seconds of this time.intintgetMonth()intgetNanos()Return the nano-seconds of this time.This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.longgetNSec()Get the nano-second (only) part of the time.static StringgetRubyTimeZoneName(String envTZ, org.joda.time.DateTime dt) static StringgetRubyTimeZoneName(Ruby runtime, org.joda.time.DateTime dt) intlonglongstatic org.joda.time.DateTimeZonegetTimeZone(Ruby runtime, long seconds) private static org.joda.time.DateTimeZonegetTimeZoneFromHHMM(Ruby runtime, String name, boolean positive, String hours, String minutes, String seconds) static org.joda.time.DateTimeZonegetTimeZoneFromString(Ruby runtime, String zone) static org.joda.time.DateTimeZonegetTimeZoneFromTZString(Ruby runtime, String zone) static org.joda.time.DateTimeZonegetTimeZoneFromUtcOffset(ThreadContext context, IRubyObject arg) static org.joda.time.DateTimeZonegetTimeZoneWithOffset(Ruby runtime, String zoneName, int offset) longgetUSec()Get the micro-second (only) part of the time.intgetYear()gmt()gmtime()hash()rb_obj_id Will return the hash code of this object.inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.hour()private static booleaninDaylighTime(org.joda.time.DateTime dt) initialize(ThreadContext context) initialize(ThreadContext context, IRubyObject year) initialize(ThreadContext context, IRubyObject[] args) initialize(ThreadContext context, IRubyObject year, IRubyObject month) initialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day) private IRubyObjectinitialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day, IRubyObject hour, IRubyObject minute, IRubyObject second) private IRubyObjectinitialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day, IRubyObject hour, IRubyObject minute, IRubyObject second, IRubyObject zone) 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 StringinspectCommon(org.joda.time.format.DateTimeFormatter formatter, org.joda.time.format.DateTimeFormatter utcFormatter) static RaiseExceptioninvalidUTCOffset(Ruby runtime) isdst()booleanisUTC()static RubyTimeload(IRubyObject recv, IRubyObject from, Block block) Deprecated.static RubyTimeload(ThreadContext context, IRubyObject recv, IRubyObject from) static RubyTimelocal(ThreadContext context, IRubyObject recv, IRubyObject[] args) final RubyTimelocaltime(ThreadContext context) localtime(ThreadContext context, IRubyObject arg) final RubyTimelocaltime19(ThreadContext context, IRubyObject[] args) Deprecated.private static booleanmday()mdump()Deprecated.private RubyStringlongDeprecated.min()monday_p(ThreadContext context) month()static RubyTimenewInstance(ThreadContext context, IRubyObject recv) static IRubyObjectnewInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) Deprecated.static RubyTimestatic RubyTimestatic RubyTimeCreate new (Ruby) Time instance.static RubyTimenewTimeFromNanoseconds(Ruby runtime, long nanoseconds) nsec()Get the fractional part of time in nanoseconds.private static RubyNumericnumExact(ThreadContext context, IRubyObject v) op_cmp(ThreadContext context, IRubyObject other) op_eqq(ThreadContext context, IRubyObject other) rb_equal The Ruby "===" method is used by default in case/when statements.op_equal(ThreadContext context, IRubyObject other) rb_obj_equal Will by default use identity equality to compare objects.op_ge(ThreadContext context, IRubyObject other) op_gt(ThreadContext context, IRubyObject other) op_le(ThreadContext context, IRubyObject other) op_lt(ThreadContext context, IRubyObject other) op_minus(IRubyObject other) op_minus(ThreadContext context, IRubyObject other) op_minus19(ThreadContext context, IRubyObject other) Deprecated.op_plus(IRubyObject other) op_plus(ThreadContext context, IRubyObject other) op_plus19(ThreadContext context, IRubyObject other) Deprecated.private RubyTimeprivate RubyFloatprivate RubyTimeopPlusMillis(Ruby runtime, double adjustMillis) private static org.joda.time.DateTimeZoneparseTZString(Ruby runtime, String zone) private static org.joda.time.DateTimeZoneparseZoneString(Ruby runtime, String zone) round(ThreadContext context, IRubyObject[] args) private static RubyTimes_mload(ThreadContext context, RubyTime time, IRubyObject from) static IRubyObjects_new(IRubyObject recv, IRubyObject[] args, Block block) Deprecated.private static intsafeCmp(ThreadContext context, RubyTime self, IRubyObject other) saturday_p(ThreadContext context) sec()voidsetDateTime(org.joda.time.DateTime dt) private voidsetIsTzRelative(boolean tzRelative) voidsetMicros(int micros) Sets the microsecond part for this Time object.voidsetMicroseconds(long micros) Deprecated.usesetMicros(int)insteadvoidsetNanos(int nanos) Sets the nanosecond part for this Time object.voidsetNSec(long nsec) Set the nano-second (only) part for this time.voidsetUSec(long usec) Set the micro-second (only) part of the time.voidsetZoneObject(IRubyObject zone) private static JavaSites.TimeSitessites(ThreadContext context) strftime(IRubyObject format) Deprecated.strftime(ThreadContext context, IRubyObject format) subsec()Deprecated.subsec(ThreadContext context) succ()sunday_p(ThreadContext context) thursday_p(ThreadContext context) static RubyTimetimeZoneLocal(ThreadContext context, IRubyObject off, RubyTime time) private static org.joda.time.DateTimeZonetimeZoneWithOffset(String zoneName, int offset) to_a(ThreadContext context) rb_any_to_a call-seq: obj.to_a -> anArray Returns an array representation of obj.to_f()to_i()to_r(ThreadContext context) to_s()rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj.final IRubyObjectto_s19()<T> TConvert the object to the specified Java class, if possible.toString()The default toString method is just a wrapper that calls the Ruby "to_s" method.tuesday_p(ThreadContext context) voidupdateCal(org.joda.time.DateTime dt) Deprecated.usec()Get the microsecond part of this time value.static RubyTimeutc(ThreadContext context, IRubyObject recv, IRubyObject[] args) wday()wednesday_p(ThreadContext context) yday()year()zone()static booleanzoneLocalTime(ThreadContext context, IRubyObject zone, RubyTime time) static booleanzoneTimeLocal(ThreadContext context, IRubyObject zone, RubyTime time) 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, equals, inspect, puts, specificEval, toRubyStringMethods 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, defaultToJava, 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, infectBy, infectBy, initialize19, inspect, 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, methodsImpl, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, 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, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, 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, tainted_p, testFrozen, testFrozen, 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
-
UTC
- See Also:
-
ONE_MILLION_BD
-
ONE_BILLION_BD
-
TIME_SCALE
public static final int TIME_SCALE- See Also:
-
dt
private org.joda.time.DateTime dt -
nsec
private long nsec -
zone
-
ONE_DAY_CTIME_FORMATTER
private static final org.joda.time.format.DateTimeFormatter ONE_DAY_CTIME_FORMATTER -
TWO_DAY_CTIME_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TWO_DAY_CTIME_FORMATTER -
TO_S_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TO_S_FORMATTER -
TO_S_UTC_FORMATTER
private static final org.joda.time.format.DateTimeFormatter TO_S_UTC_FORMATTER -
TZ_PATTERN
-
TIME_OFFSET_PATTERN
-
TZ_STRING
-
isTzRelative
private boolean isTzRelative -
TIME0
private static final org.joda.time.DateTime TIME0
-
-
Constructor Details
-
RubyTime
-
RubyTime
-
RubyTime
-
-
Method Details
-
setIsTzRelative
private void setIsTzRelative(boolean tzRelative) -
getNativeClassIndex
Description copied from class:RubyObjectThis is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex- Specified by:
getNativeClassIndexin interfaceCoreObjectType- Overrides:
getNativeClassIndexin classRubyObject- See Also:
-
getEnvTimeZone
-
getLocalTimeZone
-
getTimeZoneFromTZString
-
parseTZString
-
getTimeZoneFromString
-
parseZoneString
-
getTimeZoneFromUtcOffset
public static org.joda.time.DateTimeZone getTimeZoneFromUtcOffset(ThreadContext context, IRubyObject arg) -
invalidUTCOffset
-
numExact
-
getTimeZoneFromHHMM
-
getTimeZone
-
getTimeZoneWithOffset
-
timeZoneWithOffset
-
createTimeClass
-
setNSec
public void setNSec(long nsec) Set the nano-second (only) part for this time. Note thatnsecmeans the 4 to 9 decimal places of sec fractional part of time. For example, 123456 fornsecmeans.000123456, not.123456000.- Parameters:
nsec- the nano second part only (4 to 9 decimal places) of time
-
getNSec
public long getNSec()Get the nano-second (only) part of the time. Note that it returns the 4 to 9 decimal places, not the entire sec fraction part till nano. For example for an epoch second1500000000.123456789returns456789.- Returns:
- the nano second part (only) of time
-
setUSec
public void setUSec(long usec) Set the micro-second (only) part of the time.- Parameters:
usec-- See Also:
-
getUSec
public long getUSec()Get the micro-second (only) part of the time.- Returns:
- the micro-second only part of this time
- See Also:
-
setZoneObject
-
updateCal
Deprecated.UsesetDateTime(DateTime)instead. -
newTime
-
newTimeFromNanoseconds
-
newTime
-
newTime
Create new (Ruby) Time instance. Note thatdtoforg.joda.time.DateTimerepresents the integer part and the fraction part to milliseconds, andnsecthe nano part (4 to 9 decimal places). For example,RubyTime.newTime(rt, new DateTime(987000), 345678)creates an epoch second of987.000345678, not987000.345678.- Parameters:
runtime- the runtimedt- the integer part of time + the fraction part in millisecondsnsec- the nanos only party of the time (millis excluded)- Returns:
- the new Time
- See Also:
-
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
-
succ
-
gmtime
-
localtime
-
localtime
-
localtime
-
adjustTimeZone
-
localtime19
Deprecated. -
gmt
-
isUTC
public boolean isUTC() -
getgm
-
getlocal
-
getlocal
-
getlocal
-
getlocal19
Deprecated. -
strftime
Deprecated. -
strftime
-
op_equal
Description copied from class:RubyBasicObjectrb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics. The name of this method doesn't follow the convention because hierarchy problems- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
safeCmp
-
op_ge
-
op_gt
-
op_le
-
op_lt
-
cmp
-
op_plus
-
op_plus
-
op_plus19
Deprecated. -
opPlusMillis
-
opMinus
-
op_minus
-
op_minus
-
op_minus19
Deprecated. -
opMinus
-
op_eqq
Description copied from class:RubyObjectrb_equal The Ruby "===" method is used by default in case/when statements. The Object implementation first checks Java identity equality and then calls the "==" method too.- Specified by:
op_eqqin interfaceIRubyObject- Overrides:
op_eqqin classRubyObject
-
op_cmp
- Overrides:
op_cmpin classRubyBasicObject
-
eql_p
Description copied from class:RubyBasicObjectrb_obj_equal Just like "==" and "equal?", "eql?" will use identity equality for Object.- Overrides:
eql_pin classRubyBasicObject
-
asctime
-
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_s19
-
inspectCommon
private String inspectCommon(org.joda.time.format.DateTimeFormatter formatter, org.joda.time.format.DateTimeFormatter utcFormatter) -
toString
Description copied from class:RubyObjectThe default toString method is just a wrapper that calls the Ruby "to_s" method.- Overrides:
toStringin classRubyObject
-
to_a
Description copied from class:RubyBasicObjectrb_any_to_a call-seq: obj.to_a -> anArray Returns an array representation of obj. For objects of classObjectand others that don't explicitly override the method, the return value is an array containingself. However, this latter behavior will soon be obsolete. self.to_a #=> -:1: warning: default `to_a' will be obsolete "hello".to_a #=> ["hello"] Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"] The default to_a method is deprecated.- Overrides:
to_ain classRubyBasicObject
-
to_f
-
to_i
-
nsec
Get the fractional part of time in nanoseconds. Note that this returns the entire fraction part of the time in nanosecond, unlikeRubyTime#getNSec. This method represents Ruby'snsecmethod.- Returns:
- the (sec) fractional part of time (in nanos)
-
to_r
-
usec
Get the microsecond part of this time value.- Returns:
- the (whole) microsecond part of time
-
getTimeInMicros
public long getTimeInMicros()- Returns:
- the total time in microseconds
- See Also:
-
getMicros
public int getMicros()Return the micro-seconds of this time.- Returns:
- micro seconds (only)
- See Also:
-
setMicros
public void setMicros(int micros) Sets the microsecond part for this Time object.- Parameters:
micros- the microseconds to be set- See Also:
-
setMicroseconds
public void setMicroseconds(long micros) Deprecated.usesetMicros(int)instead -
microseconds
public long microseconds()Deprecated.usegetMicros()instead -
getNanos
public int getNanos()Return the nano-seconds of this time.- Returns:
- nano seconds (only)
-
setNanos
public void setNanos(int nanos) Sets the nanosecond part for this Time object.- Parameters:
nanos- the nanoseconds to be set- See Also:
-
sec
-
min
-
hour
-
mday
-
month
-
year
-
wday
-
yday
-
sunday_p
-
monday_p
-
tuesday_p
-
wednesday_p
-
thursday_p
-
friday_p
-
saturday_p
-
subsec
Deprecated. -
subsec
-
gmt_offset
-
isdst
-
zone
-
getZoneName
-
getRubyTimeZoneName
-
getRubyTimeZoneName
-
inDaylighTime
private static boolean inDaylighTime(org.joda.time.DateTime dt) -
setDateTime
public void setDateTime(org.joda.time.DateTime dt) -
getDateTime
public org.joda.time.DateTime getDateTime() -
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
-
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:
-
dump
-
dump
-
dump
Deprecated. -
mdump
Deprecated. -
mdump
-
round
-
s_new
Deprecated. -
newInstance
@Deprecated public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) Deprecated. -
newInstance
-
at
-
at
public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) -
at
public static IRubyObject at(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) -
at
-
atOpts
private static IRubyObject atOpts(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject opts) -
at1
-
atMulti
private static RubyTime atMulti(ThreadContext context, RubyClass recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject zone) -
local
-
initialize
- Overrides:
initializein classRubyBasicObject
-
initialize
-
initialize
-
initialize
public IRubyObject initialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day) -
initialize
-
initialize
private IRubyObject initialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day, IRubyObject hour, IRubyObject minute, IRubyObject second) -
initialize
private IRubyObject initialize(ThreadContext context, IRubyObject year, IRubyObject month, IRubyObject day, IRubyObject hour, IRubyObject minute, IRubyObject second, IRubyObject zone) -
maybeTimezoneObject
-
findTimezone
-
utc
-
allocateInstance
-
load
Deprecated. -
load
-
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:
-
getTimeInMillis
public long getTimeInMillis()- Returns:
- millis since epoch this (date-time) value represents
- Since:
- 9.2 (public)
-
getYear
public int getYear()- Returns:
- year
- Since:
- 9.2
-
getMonth
public int getMonth()- Returns:
- month-of-year (1..12)
- Since:
- 9.2
-
getDay
public int getDay()- Returns:
- day-of-month
- Since:
- 9.2
-
getHour
public int getHour()- Returns:
- hour-of-day (0..23)
- Since:
- 9.2
-
getMinute
public int getMinute()- Returns:
- minute-of-hour
- Since:
- 9.2
-
getSecond
public int getSecond()- Returns:
- second-of-minute
- Since:
- 9.2
-
getJavaDate
- Returns:
- a Java (legacy) Date instance
- Since:
- 1.7
-
toInstant
- Returns:
- an instant
- Since:
- 9.2
-
toLocalDateTime
- Returns:
- a date time
- Since:
- 9.2
-
toZonedDateTime
- Returns:
- a date time
- Since:
- 9.2
-
toOffsetDateTime
- Returns:
- a date time
- Since:
- 9.2
-
convertTimeInterval
-
s_mload
-
zoneTimeLocal
-
zoneLocalTime
-
timeZoneLocal
-
extractTime
-
sites
-
getMicros()instead