Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q687 How can I include today's date in the url of a link?

irt.org | Knowledge Base | JavaScript | Link | Q687 [ previous next ]

Q687 How can I include today's date in the url of a link?

Try:

<SCRIPT LANGUAGE = 'JavaScript'><!--
function xx(number) { return (number < 10) ? '0' + number : number; }
var date = new Date();
var dd=xx(date.getDate()), mm=xx(date.getMonth()+1), yy=xx(date.getYear());

document.write(day + "/" + month + "/" + year);
//--></SCRIPT>

<A HREF="http://www.irt.org/" onClick="this.href='http://www.irt.org/' + mm + dd + yy + '.htm'">today</A>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.