cinek Posted March 12, 2008 Posted March 12, 2008 is it poss to display only the date using javascript? e.g. 12th March 2008 not 12th March 2008 <time/time zone> ?
Management terabyte Posted March 13, 2008 Management Posted March 13, 2008 Try checking those tutorials:http://javascript.about.com/library/bldtime2.htmhttp://www.dicabrio.com/javascript/time-zone-clock.phphttp://www.spip-contrib.net/Display-date-and-time-in-the Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
MPFF Posted March 14, 2008 Posted March 14, 2008 It's a simple javascript place the code below were you want it <script type="text/javascript"> <!-- var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() document.write(day + "/" + month + "/" + year) //--> </script>
cinek Posted March 14, 2008 Author Posted March 14, 2008 (edited) thanks :lol: what if i want to save this in another file (*.js)? how can I import it to my index.html ? I tried the <script type="text/javascript" src="date.js"></script> but it doesn't show :) Edited March 14, 2008 by cinek
MPFF Posted March 14, 2008 Posted March 14, 2008 yeah ya can do that open notepad and copy the following Copy & Paste var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() document.write(day + "/" + month + "/" + year) File Save As date.js Upload and just Place <script type="text/javascript" src="date.js"></script> were u want it :lol: enjoy
cinek Posted March 14, 2008 Author Posted March 14, 2008 got it to work, silly mistake hehe thanks a lot :lol:
Management terabyte Posted March 14, 2008 Management Posted March 14, 2008 The issue/request this topic was opened for has now been resolved. If you need further assistance, please open a new topic. If this topic was closed prematurely, please contact me so I can re-open it. :lol: Topic Closed Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
Recommended Posts