Javascript strftime
<script type="text/javascript" src="http://dren.ch/js/strftime.js"></script> <script type="text/javascript"> var d = new Date(); alert(d.strftime('Today is %A %B %e, day %j of the year %Y')); </script>
Please refer to the FreeBSD strftime documentation if you are not familiar with the format codes.
"Known issues":
- I made no attempts at i18n or l10n
- Z and z worked under spidermonkey in a kludgy way and broke under IE and Safari, so they're commented out for now
- Still missing %U, %V, and %W, and I also made no attempt to implement %E* and %O*
- As a bonus of sorts, Number objects get a new pad() method (read the code if you're interested)
- Overall it's only "lightly tested"
- Somebody already did this
May 4, 2006 : link