Date manipulation: Difference between revisions
Content deleted Content added
m →{{header|zkl}}: typeo |
|||
Line 1,820: | Line 1,820: | ||
=={{header|zkl}}== |
=={{header|zkl}}== |
||
The iso8601 library offers additional Time/Date support but using the built in stuff: |
The iso8601 library offers additional Time/Date support but using the built in stuff: |
||
<lang zkl>var |
<lang zkl>var Date=Time.Date; |
||
fcn add12h(dt){ |
fcn add12h(dt){ |
||
re:=RegExp(0'|(\w+)\s+(\d+)\s+(\d+)\ +(.+)\s|); |
re:=RegExp(0'|(\w+)\s+(\d+)\s+(\d+)\ +(.+)\s|); |
||
Line 1,828: | Line 1,828: | ||
h,m,s:=Date.parseTime(hms); //19,30,0 |
h,m,s:=Date.parseTime(hms); //19,30,0 |
||
dti:=T(Y,M,D, h,m,s).apply("toInt"); |
dti:=T(Y,M,D, h,m,s).apply("toInt"); |
||
Y,M,D, h,m,s |
Y,M,D, h,m,s=Date.addHMS(dti,12); |
||
"%s %d %d %s".fmt(Date.monthNames[M],D,Y,Date.toAMPMString(h,m)); |
"%s %d %d %s".fmt(Date.monthNames[M],D,Y,Date.toAMPMString(h,m)); |
||
}</lang> |
|||
} |
|||
⚫ | |||
⚫ | |||
{{out}}<pre>March 8 2009 07:30AM</pre> |
{{out}}<pre>March 8 2009 07:30AM</pre> |
||