Date manipulation: Difference between revisions
→{{header|langur}}
(Added MiniScript) |
Langurmonkey (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1,796:
Langur currently uses the Go time package. Testing with Go 1.14.1 on Linux, the time package doesn't seem to parse "EST" correctly, and it seems to fail silently. Given these conditions, I use "-05:00" instead of "EST" in the input string.
<syntaxhighlight lang="langur">val .input = "March 7 2009 7:30pm -05:00"
val .iformat = "January 2 2006 3:04pm -07:00"
val .
val .d1 =
val .d2 = .d1 +
val .d3 =
val .d4 =
val .d5 =
val .d6 =
val .d7 =
writeln "input string: ", .input
writeln "input format string: ", .iformat
writeln "output format string: ", .
writeln()
writeln $"original: \.d1; (\.d1:dt
writeln $"+12 hours: \.d2; (\.d2:dt
writeln $"in Arizona: \.d3; (\.d3:dt
writeln $"in local time zone: \.d4; (\.d4:dt
writeln $"in UTC: \.d5; (\.d5:dt
writeln $"+02:30 time zone: \.d6; (\.d6:dt
writeln $"in EST: \.d7; (\.d7:dt
{{out}}
|