WebSite X5Help Center

 
Duncan Baker
Duncan Baker
User

Show date on page  en

Автор: Duncan Baker
Просмотрено 802, Подписчики 1, Размещенный 0  

Is there a widget to allow me to show the date on a website?

If not - any pointers to a thirt party solution would be much appreciated!

TVMIA

Duncan

Размещено
5 Ответы
John S.
John S.
User

Look here: https://www.w3schools.com/js/js_dates.asp

There are many ways to do what you want. Jaca or PHP.

The example page delivers code you can copy and put into a html object.

The code can be edited as you wish.

Читать больше
Размещено От John S.
John S.
John S.
User

Jaca >>> java

Читать больше
Размещено От John S.
Duncan Baker
Duncan Baker
User
Автор

Thanks John

Читать больше
Размещено От Duncan Baker
John S.
John S.
User

Could be something like this:

<div id="demo"></div>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>

Читать больше
Размещено От John S.
John S.
John S.
User

Beware that the date/time is "static" unless you make code to refresh it.

Maybe it is better to have only the date like this:

<div id="date"></div>

<script>
var date = (new Date()).toISOString().split('T')[0];
document.getElementById('date').innerHTML = date;
</script>

Читать больше
Размещено От John S.