Go Around The Tech Corner…

JS Tip 3: How to display the date and time using JavaScript

Posted on: November 8, 2009


This is a very simple one. JavaScript has inbuilt functions that you just include in your code. See the snippet below:

<html>
<title>Time & Date Display</title>
<head>
<script language = "JavaScript">
var today = new Date()
document.write(today);
</script>
</head>
<body>
Displaying Time Using JavaScript
</body>
</html>

That’s just about it. You declare a variable called today and assign it the Date() function. Then use document.write to display it on your webpage.

–          Millie

Advertisements

1 Response to "JS Tip 3: How to display the date and time using JavaScript"

At tt281.wordpress I show a similar idea but calling a function from xhtml.

TT281 blogger

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Me – The author of this blog!


This is my tech blog. I got another blog, full of jokes that will crack u up! http://humoraddict.blogspot.com

Follow milliepatel84 on Twitter

Tweet Tweet…!!!!

Blog Stats

  • 43,631 hits

Top Clicks

  • None

Flickr Photos

JWL8376  Cuckoo..

Chrysis duo

Smoky Mountain Blaze

Peaceful

More Photos
%d bloggers like this: