Date manipulation: Difference between revisions

m
(Added Fōrmulæ)
Line 1,374:
 
=={{header|Julia}}==
===without TimeZones library===
{{works with|Julia|0.6}}
<lang julia>using Base.Dates
Julia <tt>Base.Dates</tt> currently doesn't support "am/pm" parsing, neither "EST" specification.
 
<lang julia>using Base.Dates
 
function main()
Line 1,388 ⟶ 1,386:
end
 
main()</lang>
</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}}==
4,104

edits