ShowDate Function | JavaScriptSource

ShowDate Function

Demetrius Francis Nov 18, 2004
This script is a great example that shows the date in different formats from one function. Seeing the examples makes this script easy to modify and can be used to help understand the underlying code.

Syntax:

Showdate ( [date object|string], [day string], [month string], [date string], [year string], [delimeter string] )

Date:- Javascript date object in the form new Date(), new Date(1982,06,30).

Day:- Day string in the form "dddd" or "ddd".

Month:- Month string in the form "mmmm", "mmm", "mm".

Date:- Date string in the form "dddd", "ddd", "dd", "d".

Year:- Year string in the form "yyyy", "yy".


Example Results
Showdate(new Date(), 'dddd', 'mmm', 'dd', 'yyyy', '-')
Showdate(new Date(), 'dd', 'mm', 'dd', 'yyyy', '.')
Showdate(new Date(2001,11,25), 'dddd', 'mmm', 'dd', 'yy', ' ')

Download showdate.js

The JavaScript Source: Time and Date: ShowDate Function

Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!

    

Did you use this script?  Do you like this site?  Please link to us!

Leave a Response

(
0 comments)