View Full Version : Date script needed
websterthehamster
02-02-2011, 10:05 PM
Hi, I need a simple javascript thingy that shows just the date in the format: OCT 11
The day number needs to be able to be separated by a <br/> tag from the month abbreviation.
Thanks for the help!:)
djr33
02-02-2011, 10:10 PM
Try this as a place to start:
http://www.mediacollege.com/internet/javascript/date-time/
Found by searching for "javascript show date" on google-- please at least try a search before posting for help.
websterthehamster
02-02-2011, 10:15 PM
Sorry about that. My mom has WebWatcher on my computer, and Google is disabled. I can only visit certain websites, and this is one of them.
Thanks anyways! :)
djr33
02-03-2011, 12:25 AM
You'll need access to many different sites to become a successful designer. Of course you will have to work that out as you can. But until then, it's extra work if we can't help you by providing links or you can't look these things up yourself.
But for the moment, here's the code from that page. You should be able to modify it as required.
//http://www.mediacollege.com/internet/javascript/date-time/
//To use the Date/Month/Year format ( e.g. 2 February 2011 ):
<script type="text/javascript"><!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('January','February','March','April','May',
'June','July','August','September','October','November','December');
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
document.write(day + " " + months[month] + " " + year);
//--></script>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.