Visualizzazione dei risultati da 1 a 5 su 5

Discussione: data e ora

  1. #1

    data e ora

    salve a tutti,
    questo script mi da la data e l'ora in versione inglese
    qualcuno di voi saprebbe dirmi cosa modificare per avere la data e l'ora in italiano (giorno/mese/anno/ora)?
    grazie
    ciauz

    <script language="JavaScript">
    <!--

    //Get Date
    var months=new Array(13);
    months[1]="Gennaio";
    months[2]="Febbraio";
    months[3]="Marzo";
    months[4]="Aprile";
    months[5]="Maggio";
    months[6]="Giugno";
    months[7]="Luglio";
    months[8]="Agosto";
    months[9]="Settembre";
    months[10]="Ottobre";
    months[11]="Novembre";
    months[12]="Dicembre";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDate();
    var year=time.getYear();
    if (year < 2000)
    year = year + 1900;

    //Get Time
    var now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes()
    var timeValue = "" + ((hours >12) ? hours -12 :hours)
    if (timeValue == "0") timeValue = 12;
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += (hours >= 12) ? " pm" : " am"

    //Get Day
    var days=new Array(7);
    days[0]="Domenica";
    days[1]="Lunedi";
    days[2]="Martedi";
    days[3]="Mercoledi";
    days[4]="Giovedi";
    days[5]="Vnerdi";
    days[6]="Sabato";
    var lday=days[time.getDay()];

    //-->
    </script>

  2. #2
    Utente di HTML.it L'avatar di v2v2
    Registrato dal
    Sep 2002
    Messaggi
    221
    Posta anche il richiamo allo script
    Only the good die young
    all the evil seem to live forever

    :metallica

  3. #3
    <head><script src="rcdatetime.js"></script></head>

    <body><script language="javascript">
    document.write(lday + ", " +lmonth + " " + date + ", " + year + " " + timeValue);
    </script>
    </body>

  4. #4
    Utente di HTML.it L'avatar di v2v2
    Registrato dal
    Sep 2002
    Messaggi
    221
    codice:
    <head><script src="rcdatetime.js"></script></head> 
    
    <body><script language="javascript"> 
    document.write(lday + ", " +date + " " + lmonth + ", " + year + " " + timeValue); 
    </script> 
    </body>
    Only the good die young
    all the evil seem to live forever

    :metallica

  5. #5
    grazie,
    però questo script non fa il refresh automatico dei minuti...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.