AliciaCrane
Posts: 11
Joined: Sat Jul 23, 2016 1:09 am

Date and time

Mon Aug 08, 2016 8:21 am

I am trying to make a webserver using html and wish to display the date and time how do i do that??

Code: Select all

<html>
<head>
</head>
<body><h1>MALAYSIA</h1>
</body>
</html>
I want the time and date to be below the MALAYSIA line.
Anyone help??

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Date and time

Mon Aug 08, 2016 9:04 am

Which time and date?

The time and date of the person browsing the website?
The time and date on the computer hosting the website?

Either way you either need to do some server side scripting with something like PHP or some client side scripting using JavaScript.

PHP Example
JavaScript Example
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
DougieLawson
Posts: 39297
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Date and time

Tue Aug 09, 2016 9:01 pm

If your web browser isn't running on a RPi then this ugly shockwave thing does a nice clock (based on the browser's time of day clock).

Code: Select all

<center><embed src="http://www.clocklink.com/clocks/world001-gray.swf?TimeZone=BST&"  width="720" height="375" wmode="transparent" type="application/x-shockwave-flash"></center>
I've not bothered seeing if that works with Pepperflash.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”