DateTime 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.
RubyDate
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final ByteList | |
| private static final ByteList |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | |
| public | |
| pack-priv | |
| private | RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, long[] rest, int off, long start)
|
| private | |
| pack-priv | |
| pack-priv | RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt, int off, long start, long subMillisNum, long subMillisDen)
|
| pack-priv | RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, Chronology chronology, int off)
|
| Modifier and Type | Method and Description |
|---|---|
| public static IRubyObject | _strptime(ThreadContext context, IRubyObject self, IRubyObject string)
Hides org.
|
| public static IRubyObject | _strptime(ThreadContext context, IRubyObject self, IRubyObject string, IRubyObject format)
Hides org.
|
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| public static RubyDateTime | civil(ThreadContext context, IRubyObject self)
Hides org. # Create a new DateTime object corresponding to the specified # Civil Date and hour +h+, minute +min+, second +s+. |
| public static RubyDateTime | civil(ThreadContext context, IRubyObject self, IRubyObject year)
Hides org.
|
| public static RubyDateTime | civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month)
Hides org.
|
| public static RubyDateTime | civil(ThreadContext context, IRubyObject self, IRubyObject[] args)
Hides org.
|
| pack-priv static void | |
| pack-priv static long | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static int | |
| private static boolean | |
| public static RubyDateTime | jd(ThreadContext context, IRubyObject self)
Hides org. # Create a new DateTime object corresponding to the specified # Julian Day Number +jd+ and hour +h+, minute +min+, second +s+. |
| public static RubyDateTime | |
| pack-priv RubyDate | newInstance(final ThreadContext context, final DateTime dt, int off, long start, long subNum, long subDen)
Overrides org.
|
| public IRubyObject | |
| public static RubyDateTime | now(ThreadContext context, IRubyObject self)
# Create a new DateTime object representing the current time. |
| public static RubyDateTime | |
| public IRubyObject | |
| private RubyDate | |
| public RubyString | |
| public RubyString | |
| public RubyDate | |
| public RubyDateTime | |
| public RubyString | |
| public RubyTime | |
| public <T> T | toJava(Class<T>
The target type to which the object should be converted. target)Overrides org. Implements org. Convert the object to the specified Java class, if possible. |
| public LocalDateTime | |
| public OffsetDateTime | |
| public ZonedDateTime | |
| pack-priv static DateTime |
| DEFAULT_FORMAT | back to summary |
|---|---|
| private static final String DEFAULT_FORMAT | |
| STRF_FORMAT_BYTES | back to summary |
|---|---|
| private static final ByteList STRF_FORMAT_BYTES | |
| TO_S_FORMAT | back to summary |
|---|---|
| private static final ByteList TO_S_FORMAT | |
| RubyDateTime | back to summary |
|---|---|
| protected RubyDateTime(Ruby runtime, RubyClass klass) | |
| RubyDateTime | back to summary |
|---|---|
| public RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt) | |
| RubyDateTime | back to summary |
|---|---|
| public RubyDateTime(Ruby runtime, DateTime dt)
Deprecated since 10.0.
| |
| RubyDateTime | back to summary |
|---|---|
| public RubyDateTime(Ruby runtime, long millis, Chronology chronology) | |
| RubyDateTime | back to summary |
|---|---|
| pack-priv RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, int off, long start) | |
| RubyDateTime | back to summary |
|---|---|
| private RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, long[] rest, int off, long start) | |
| RubyDateTime | back to summary |
|---|---|
| private RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt, int off) | |
| RubyDateTime | back to summary |
|---|---|
| pack-priv RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt, int off, long start) | |
| RubyDateTime | back to summary |
|---|---|
| pack-priv RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt, int off, long start, long subMillisNum, long subMillisDen) | |
| RubyDateTime | back to summary |
|---|---|
| pack-priv RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, Chronology chronology, int off) | |
| _strptime | back to summary |
|---|---|
| public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject string) Hides org.
| |
| _strptime | back to summary |
|---|---|
| public static IRubyObject _strptime(ThreadContext context, IRubyObject self, IRubyObject string, IRubyObject format) Hides org.
| |
| addFraction | back to summary |
|---|---|
| private static void addFraction(ThreadContext context, final long[] rest, RubyNumeric fr, boolean roundFloat) | |
| addRationalModToRest | back to summary |
|---|---|
| private static void addRationalModToRest(ThreadContext context, IRubyObject val, long ival, final long[] rest) | |
| addRationalModToRest | back to summary |
|---|---|
| private static void addRationalModToRest(ThreadContext context, RubyRational rat, long ival, final long[] rest) | |
| assertValidFraction | back to summary |
|---|---|
| private static void assertValidFraction(ThreadContext context, IRubyObject val, long ival) | |
| calcBigIntDayRest | back to summary |
|---|---|
| private static void calcBigIntDayRest(ThreadContext context, final RubyRational day, final long d, final long[] rest) | |
| civil | back to summary |
|---|---|
| public static RubyDateTime civil(ThreadContext context, IRubyObject self) Hides org. # Create a new DateTime object corresponding to the specified # Civil Date and hour +h+, minute +min+, second +s+. # # The 24-hour clock is used. Negative values of +h+, +min+, and # +sec+ are treating as counting backwards from the end of the # next larger unit (e.g. a +min+ of -2 is treated as 58). No # wraparound is performed. If an invalid time portion is specified, # an ArgumentError is raised. # # +of+ is the offset from UTC as a fraction of a day (defaults to 0). # +sg+ specifies the Day of Calendar Reform. # # +y+ defaults to -4712, +m+ to 1, and +d+ to 1; this is Julian Day # Number day 0. The time values default to 0.
| |
| civil | back to summary |
|---|---|
| public static RubyDateTime civil(ThreadContext context, IRubyObject self, IRubyObject year) Hides org.
| |
| civil | back to summary |
|---|---|
| public static RubyDateTime civil(ThreadContext context, IRubyObject self, IRubyObject year, IRubyObject month) Hides org.
| |
| civil | back to summary |
|---|---|
| public static RubyDateTime civil(ThreadContext context, IRubyObject self, IRubyObject[] args) Hides org.
| |
| createDateTimeClass | back to summary |
|---|---|
| pack-priv static void createDateTimeClass(ThreadContext context, RubyClass Date) | |
| getDay | back to summary |
|---|---|
| pack-priv static long getDay(ThreadContext context, IRubyObject day, final long[] rest) | |
| getHour | back to summary |
|---|---|
| pack-priv static int getHour(ThreadContext context, IRubyObject hour, final long[] rest) | |
| getMinute | back to summary |
|---|---|
| pack-priv static int getMinute(ThreadContext context, IRubyObject val, final long[] rest) | |
| getSecond | back to summary |
|---|---|
| pack-priv static int getSecond(ThreadContext context, IRubyObject val, final long[] rest) | |
| isSecondAWholeNumber | back to summary |
|---|---|
| private static boolean isSecondAWholeNumber(ThreadContext context, IRubyObject val) | |
| jd | back to summary |
|---|---|
| public static RubyDateTime jd(ThreadContext context, IRubyObject self) Hides org. # Create a new DateTime object corresponding to the specified # Julian Day Number +jd+ and hour +h+, minute +min+, second +s+. # # The 24-hour clock is used. Negative values of +h+, +min+, and # +sec+ are treating as counting backwards from the end of the # next larger unit (e.g. a +min+ of -2 is treated as 58). No # wraparound is performed. If an invalid time portion is specified, # an ArgumentError is raised. # # +of+ is the offset from UTC as a fraction of a day (defaults to 0). # +sg+ specifies the Day of Calendar Reform. # # All day/time values default to 0.
| |
| jd | back to summary |
|---|---|
public static RubyDateTime jd(ThreadContext context, IRubyObject self, IRubyObject[] args)
| |
| newInstance | back to summary |
|---|---|
| pack-priv RubyDate newInstance(final ThreadContext context, final DateTime dt, int off, long start, long subNum, long subDen) Overrides org.
| |
| next_day | back to summary |
|---|---|
| public IRubyObject next_day(ThreadContext context, IRubyObject n) Overrides org.
| |
| now | back to summary |
|---|---|
| public static RubyDateTime now(ThreadContext context, IRubyObject self) # Create a new DateTime object representing the current time. # # +sg+ specifies the Day of Calendar Reform.
| |
| now | back to summary |
|---|---|
public static RubyDateTime now(ThreadContext context, IRubyObject self, IRubyObject sg)
| |
| prev_day | back to summary |
|---|---|
| public IRubyObject prev_day(ThreadContext context, IRubyObject n) Overrides org.
| |
| prevNextDay | back to summary |
|---|---|
| private RubyDate prevNextDay(ThreadContext context, IRubyObject n, final boolean negate) | |
| strftime | back to summary |
|---|---|
| public RubyString strftime(ThreadContext context) Overrides org.
| |
| strftime | back to summary |
|---|---|
| public RubyString strftime(ThreadContext context, IRubyObject fmt) Overrides org.
| |
| to_date | back to summary |
|---|---|
public RubyDate to_date(ThreadContext context)
| |
| to_datetime | back to summary |
|---|---|
public RubyDateTime to_datetime()
| |
| to_s | back to summary |
|---|---|
| public RubyString to_s(ThreadContext context) Overrides org.
| |
| to_time | back to summary |
|---|---|
| public RubyTime to_time(ThreadContext context) Overrides org.
| |
| toJava | back to summary |
|---|---|
| public <T> T toJava(Class<T> target) Overrides org. Implements org. Doc from org. Convert the object to the specified Java class, if possible. | |
| toLocalDateTime | back to summary |
|---|---|
public LocalDateTime toLocalDateTime()
| |
| toOffsetDateTime | back to summary |
|---|---|
public OffsetDateTime toOffsetDateTime()
| |
| toZonedDateTime | back to summary |
|---|---|
public ZonedDateTime toZonedDateTime()
| |
| withTimeAt0InZone | back to summary |
|---|---|
| pack-priv static DateTime withTimeAt0InZone(DateTime dt, DateTimeZone zone) | |