Afisarea orei si datei pe headerul paginii in OpenCart
RaporteazaIntrebare
Please briefly explain why you feel this question should be reported .
Salut,
Cine ma poate ajuta cu afisarea orei si datei pe headerul paginii sitelui creat cu platforma OpenCart.
Multumesc anticipat,
Deschis
0
Anunturi / Oferte Tehnic
Realizare magazin online
Solutii software conexe
Web Design
9 ani
5 raspuns
1732 vizualizari
0
Răspunsuri ( 5 )
Adauga codul de mai jos in header template.
Y-m-d H:i:s – poti sschimba acest format.
format(‘Y-m-d H:i:s’);
?>
Imi cer scuze, nu a fost publicat corect.
format(‘Y-m-d H:i:s’);
?>
format('Y-m-d H:i:s');
? >
Merci pt raspuns….am reusit !
Ideea este ca doresc sa se afiseze un ceas in care sa indice instantaneuu secundele , minutele…
am gasit un javascript dar nu stiu sa-l implementez corect, deoarece nu are nici-un efect…
functia date_time
function date_time(id)
{
date = new Date;
year = date.getFullYear();
month = date.getMonth();
months = new Array(‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘Jully’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’);
d = date.getDate();
day = date.getDay();
days = new Array(‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’);
h = date.getHours();
if(h<10)
{
h = "0"+h;
}
m = date.getMinutes();
if(m<10)
{
m = "0"+m;
}
s = date.getSeconds();
if(s<10)
{
s = "0"+s;
}
result = ''+days[day]+' '+months[month]+' '+d+' '+year+' '+h+':'+m+':'+s;
document.getElementById(id).innerHTML = result;
setTimeout('date_time("'+id+'");','1000');
return true;
}
care se apeleaza in header
am adaptat codul:
Display Date and Time in Javascript
window.onload = date_time(‘date_time’);
e vreo problema cu window.onload? any ideea?
Display Date and Time in Javascript
window.onload = date_time(‘date_time’);