Ad Code

Show Today's Date & Current Time As Simple Text On Your Blog

Advertisements
Here’s a simple JavaScript to show the current date anywhere in the blog. You can place this code either in any HTML/JavaScript widget, or anywhere else in the template as per you wish.
The output will be like this:
Today is Wednesday, August 2.

And the required code, to be added is this:

<script language=”Javascript”>
<!–
var dayName = new Array (“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”)
var monName = new Array (“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”)
var now = new Date
document.write(“Today is ” + dayName[now.getDay()] + “, ” + monName[now.getMonth()] + ” “+now.getDate() +”.”)
//–>
</script>
There’s an even simpler code, to display date(like this):
2/7/117

Here’s the code for that:
<script language=”Javascript”>
<!–
var now = new Date
document.write(now.getDate() + “/” + now.getMonth() + “/” + now.getYear())
//–>
</script>
Download Link
Advertisements

Post a Comment

1 Comments

  1. Thanks for this simple date code. Your technology website is good. Coding is my passion. Thanks. These small tips do help. Thanks again.

    ReplyDelete
Emoji
(y)
:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
x-)
(k)