Date format: Difference between revisions

m
→‎{{header|REXX}}: added a third version for newer REXXes.
m (→‎REXX compact version: a tiny correction)
m (→‎{{header|REXX}}: added a third version for newer REXXes.)
Line 1,518:
/* [↑] dayofweek Month dd, yyyy*/
/*stick a fork in it, we're done.*/</lang>
'''output''' is the same as the 1<sup>st</sup> version.
===modern version===
This version can be used with those REXXes that support the &nbsp; '''I''' &nbsp; (ISO) parameter for the &nbsp; '''date''' &nbsp; BIF.
<lang REXX>/*REXX pgm shows current date: yyyy-mm-dd & Dayofweek, Month dd, yyyy*/
say date('I') /*yyyy-mm-dd with leading zeroes.*/
 
say date('W')"," date('M') word(date(), 1)"," left(date('S'),4)
/* [↑] dayofweek Month dd, yyyy*/
/*stick a fork in it, we're done.*/
</lang>
'''output''' is the same as the 1<sup>st</sup> version.
<br><br>