iso8601.lzx
<library>
<class name="ISO8601Date">
<method name="stringFromDate" args="d" allocation="class">
return ( (d.getUTCFullYear()) + "-" +
lz.ISO8601Date.leadingZero(d.getUTCMonth()+1)+ "-" +
lz.ISO8601Date.leadingZero(d.getUTCDate()) + "T" +
lz.ISO8601Date.leadingZero(d.getUTCHours()) + ":" +
lz.ISO8601Date.leadingZero(d.getUTCMinutes()) + ":" +
lz.ISO8601Date.leadingZero(d.getUTCSeconds())+ "Z");
</method>
<method name="URIEncodedDate" args="d" allocation="class">
return ( (d.getUTCFullYear()) + "-" +
lz.ISO8601Date.leadingZero(d.getUTCMonth()+1)+ "-" +
lz.ISO8601Date.leadingZero(d.getUTCDate()) + "T" +
lz.ISO8601Date.leadingZero(d.getUTCHours()) + "%3A" +
lz.ISO8601Date.leadingZero(d.getUTCMinutes()) + "%3A" +
lz.ISO8601Date.leadingZero(d.getUTCSeconds())+ "Z");
</method>
<method name="leadingZero" args="n" allocation="class">
// pads a single number with a leading zero.
if (n <= 9) {
return new String("0"+n);
} else {
return new String(n);
}
</method>
</class>
</library>