Display current date and day of week javascript code (long form)
Script Description:
Display current date and day of week in long form
Cut-and-paste code inside HEAD section:
i.e., between <HEAD> and </HEAD> tags of your HTML file
Cut-and-paste code inside BODY section:
i.e., between <BODY> and </BODY> tags of your HTML file
<script language="JavaScript">document.write(this_date_string)</script>
Here is what it does:
Tutorial of how the code works:
Programming logic:
Create and define data variables:
this_weekday_name_array
contains day-of-week in English
this_month_name_array
contains months in English
Instantiate new
this_date_timestamp
from
Date
object
this_date_timestamp
stores current date
Extract date from
this_date_timestamp
into these variables:
this_weekday
this_date
this_month
this_year
Fix Y2K problem and Netscape problem.
Build the date and day-of-week string
this_date_string
from the above variables.
Run-time logic:
Simply write
this_date_string
out.
Usage:
Display date and day-of-week
in long format.
Feedback
How useful do you rate this javascript?
Excellent
Good
Neutral
Poor
Current Results
Create a FREE Alxnet Web Poll
Home Page
|
Javascript Resources
|
php Resources
Copyright © 2003
Computational Neural Systems
Inspired by
The Personal Best
<