Jump to content

Recommended Posts

Posted
is it poss to display only the date using javascript? e.g. 12th March 2008 not 12th March 2008 <time/time zone> ?
Posted

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>

Posted (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 by cinek
Posted

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

Posted

got it to work, silly mistake hehe

 

thanks a lot :lol:

Posted
anytime :lol: happy to help
  • Management
Posted

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! >

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.