Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Date-format/Oz/date-format.oz
Normal file
26
Task/Date-format/Oz/date-format.oz
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
declare
|
||||
WeekDays = unit(0:"Sunday" "Monday" "Tuesday" "Wednesday"
|
||||
"Thursday" "Friday" "Saturday")
|
||||
Months = unit(0:"January" "February" "March" "April"
|
||||
"May" "June" "July" "August" "September"
|
||||
"October" "November" "December")
|
||||
|
||||
fun {DateISO Time}
|
||||
Year = 1900 + Time.year
|
||||
Month = Time.mon + 1
|
||||
in
|
||||
Year#"-"#{Align Month}#"-"#{Align Time.mDay}
|
||||
end
|
||||
|
||||
fun {DateLong Time}
|
||||
Year = 1900 + Time.year
|
||||
in
|
||||
WeekDays.(Time.wDay)#", "#Months.(Time.mon)#" "#Time.mDay#", "#Year
|
||||
end
|
||||
|
||||
fun {Align Num}
|
||||
if Num < 10 then "0"#Num else Num end
|
||||
end
|
||||
in
|
||||
{System.showInfo {DateISO {OS.localTime}}}
|
||||
{System.showInfo {DateLong {OS.localTime}}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue