June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
15
Task/Date-manipulation/Maple/date-manipulation-1.maple
Normal file
15
Task/Date-manipulation/Maple/date-manipulation-1.maple
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
twelve_hours := proc(str)
|
||||
local dt, zone;
|
||||
local months := ["January","February","March","April","May","June","July","August","September","October","November","December"];
|
||||
dt := StringTools:-ParseTime("%B %d %Y %l:%M%p", str);
|
||||
zone := StringTools:-RegSplit(" ", str)[-1];
|
||||
dt := Date(dt:-year, dt:-month, dt:-monthDay, dt:-hour, dt:-minute, timezone = zone);
|
||||
dt := dt + 12 * Unit(hours);
|
||||
printf("%s %d %d ", months[Month(dt)], DayOfMonth(dt), Year(dt));
|
||||
if (HourOfDay(dt) >= 12) then
|
||||
printf("%d:%dpm ", HourOfDay(dt)-12, Minute(dt));
|
||||
else
|
||||
printf("%d:%dam ", HourOfDay(dt), Minute(dt));
|
||||
end if;
|
||||
printf(TimeZone(dt));
|
||||
end proc;
|
||||
3
Task/Date-manipulation/Maple/date-manipulation-2.maple
Normal file
3
Task/Date-manipulation/Maple/date-manipulation-2.maple
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
twelve_hours("March 7 2009 7:30pm EST");
|
||||
twelve_hours("March 2 2009 0:10am WET");
|
||||
twelve_hours("March 2 2009 6:30am AST");
|
||||
Loading…
Add table
Add a link
Reference in a new issue