nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/popcorn: to_json accept serialization parameters
[nit.git]
/
lib
/
date.nit
diff --git
a/lib/date.nit
b/lib/date.nit
index
19e8ceb
..
d47b33f
100755
(executable)
--- a/
lib/date.nit
+++ b/
lib/date.nit
@@
-58,9
+58,7
@@
class Time
# Get the current time of the day
init now do
var tm = new Tm.localtime
# Get the current time of the day
init now do
var tm = new Tm.localtime
- hour = tm.hour
- minute = tm.min
- second = tm.sec
+ init(tm.hour, tm.min, tm.sec)
end
# Get the difference between two times in second
end
# Get the difference between two times in second
@@
-104,9
+102,7
@@
class Date
# The date of this day
init today do
var tm = new Tm.localtime
# The date of this day
init today do
var tm = new Tm.localtime
- year = 1900 + tm.year
- month = tm.mon + 1
- day = tm.mday
+ init(1900 + tm.year, tm.mon + 1, tm.mday)
end
# `self` formatted according to ISO 8601
end
# `self` formatted according to ISO 8601