Time
in a Date
date :: DateTime :: defaultinit
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
date :: Time :: defaultinit
date :: Date :: defaultinit
date :: DateTime :: defaultinit
core :: Comparable :: defaultinit
date :: Date :: diff_months
Difference in months betweenself
and other
date :: Date :: diff_years
Difference in years betweenself
and other
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# A `Time` in a `Date`
class DateTime
super Date
super Time
redef type OTHER: DateTime
autoinit year, month, day, hour, minute, second
# Get the current `DateTime`
init now
do
super
today
end
redef fun ==(other) do return other isa DateTime and diff_days(other) == 0 and time_eq(other)
redef fun to_s do return "{super} {hour}:{minute}:{second}{time_zone}"
end
lib/date/date.nit:159,1--176,3