EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB9959: How to display the current date and time within an HTML document


Community Admin

• Strategy


How to display the current date and time within an HTML document

To include the date and time inside of an HTML document, users can employ a JavaScript. The following script will generate the desired text above a grid report:
This document was executed on
<SCRIPT type=text/javascript>
var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday + " ")
document.write(monthname + " ")
document.write(d.getDate() + ", ")
document.write(d.getFullYear()+" at ")
document.write(d.getHours()+":")
document.write(d.getMinutes()+":")
document.write(d.getSeconds())
</SCRIPT>
A sample report with this date and time is illustrated below:
 

ka04W000000Oe97QAC_0EM440000002Fxv.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

June 13, 2017

Last Updated:

June 13, 2017