Date manipulation: Difference between revisions

Line 2,290:
 
load "stdlib.ring"
thedatedateorigin = "March 7 2009 7:30pm EST"
monthname = "January February March April May June July August September October November December"
for i = 1 to 12
if thedatedateorigin[1] = monthname[i]
monthnum = i
ok
next
thedate = str2list(substr(thedatedateorigin, " ", nl))
t = thedate[4]
t1 = substr(t,"pm", "")
Line 2,311:
ap = "am"
ok
see d"Original +- " " + t1 + apdateorigin + nl
see "Manipulated - " + d + " " + t1 + ap + nl
</lang>
Output:
<pre>
08/03/Original - March 7 2009 7:3030pm amEST
Manipulated - 08/03/2009 7:30am
</pre>
 
2,468

edits