HTML 5 : Source code to display Date and Time :
Solved/Closed
Hello,
I am currently redoing a website in xHTML.
Some scripts were in Javascript (displaying the date and time)
Thursday, May 12, 2016, it is 2:43 PM.
Is it possible to do the same in HTML 5?
What is the source?
Thank you in advance
Configuration: Operating systems:
- Linux: Debian 8, Gentoo 20150505, Fedora 23, Ubuntu 15.10
--
Free "Open source" software responds to the consumer's freedom of choice and societal digital innovation in the 21st century.
I am currently redoing a website in xHTML.
Some scripts were in Javascript (displaying the date and time)
Thursday, May 12, 2016, it is 2:43 PM.
script type="text/javascript">
var d = new Date()
var j = d.getDate()
var m = d.getMonth()
var y = d.getFullYear()
var h = d.getHours()
var mn = d.getMinutes()
Is it possible to do the same in HTML 5?
What is the source?
Thank you in advance
Configuration: Operating systems:
- Linux: Debian 8, Gentoo 20150505, Fedora 23, Ubuntu 15.10
--
Free "Open source" software responds to the consumer's freedom of choice and societal digital innovation in the 21st century.
3 answers
-
ModeratorHi
No, it's not possible in HTML which is just a markup language. To display the time, you need a dynamic language like PHP or JavaScript.
--
Light a fire for someone and they will be warm for the rest of the day. Set a man on fire and he will be warm for the rest of his life. -Terry Pratchett-