Date manipulation: Difference between revisions
m
→{{header|Julia}}
(Added Fōrmulæ) |
|||
Line 1,374:
=={{header|Julia}}==
===without TimeZones library===
▲<lang julia>using Base.Dates
function main()
Line 1,388 ⟶ 1,386:
end
main()
</lang>{{out}}▼
▲{{out}}
<pre>March 08 2009 07:30</pre>
===With TimeZones.jl===
<lang julia>using Dates, TimeZones
function testdateparse()
tzabbrev = Dict("EST" => "+0500", "CST" => "+0600", "MST" => "+0700", "PST" => "+0800")
dtstr = "March 7 2009 7:30pm EST"
for (k, v) in tzabbrev
dtstr = replace(dtstr, k => v)
end
dtformat = dateformat"U dd yyyy HH:MMp zzzzz"
dtime = TimeZones.parse(ZonedDateTime, dtstr, dtformat)
println(Dates.format(dtime, dtformat))
end
testdateparse()
</lang>{{out}}
<pre>March 07 2009 07:30AM +05:00</pre>
=={{header|Kotlin}}==
|