SPS Home    >   Dgreath    >   JavaScript Code Library    >   Display Current Date

JAVASCRIPT CODE TO DISPLAY CURRENT DATE

The following script will display formatted current date on the face of a webpage within a span container providing a means to render it in the middle of a paragraph. Date displayed is user's local date. The application requires a trigger to initialize the display function and must be positioned after the first reference in the body.  This could be included in a footer script or via the body onload attribute as shown below.

DEMONSTRATION

The current date is .

JS Code for Head Container


  

Event Trigger


  

Body Container XHTML