September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Date-manipulation/Zkl/date-manipulation-1.zkl
Normal file
11
Task/Date-manipulation/Zkl/date-manipulation-1.zkl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
var Date=Time.Date;
|
||||
fcn add12h(dt){
|
||||
re:=RegExp(0'|(\w+)\s+(\d+)\s+(\d+)\ +(.+)\s|);
|
||||
re.search(dt);
|
||||
_,M,D,Y,hms:=re.matched; //"March","7","2009","7:30pm"
|
||||
M=Date.monthNames.index(M); //3
|
||||
h,m,s:=Date.parseTime(hms); //19,30,0
|
||||
dti:=T(Y,M,D, h,m,s).apply("toInt");
|
||||
Y,M,D, h,m,s=Date.addHMS(dti,12);
|
||||
"%s %d %d %s".fmt(Date.monthNames[M],D,Y,Date.toAMPMString(h,m));
|
||||
}
|
||||
1
Task/Date-manipulation/Zkl/date-manipulation-2.zkl
Normal file
1
Task/Date-manipulation/Zkl/date-manipulation-2.zkl
Normal file
|
|
@ -0,0 +1 @@
|
|||
add12h("March 7 2009 7:30pm EST").println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue