Acum este Luni 03 August 2026, 2009 05:56:21

    • Page 1 of 1
    • 1
    Forum moderator: Mihaitza  
    ora,data si te si saluta in functie de ora [script]
    hituriData adaugari : Luni, 23 March 2009, 18:22:45 | Mesajul # 1
    ADMIN
    Groupa : Utilizatori
    Reputatie : 1
    Status : Offline (neconectat)
    Code
    <script language="JavaScript" type="text/javascript">
    <!--
    // for all date displays
    // http://hituri.ucoz.net/
    today = new Date();
    year = (today.getFullYear) ? today.getFullYear() : today.getYear();
    month = today.getMonth();
    switch (month) {
                  case 0 : month = "Ian"; break;
                  case 1 : month = "Feb"; break;
                  case 2 : month = "Mar"; break;
                  case 3 : month = "Apr"; break;
                  case 4 : month = "Mai"; break;
                  case 5 : month = "Iun"; break;
                  case 6 : month = "Iul"; break;
                  case 7 : month = "Aug"; break;
                  case 8 : month = "Sep"; break;
                  case 9 : month = "Oct"; break;
                  case 10 : month = "Noe"; break;
                  case 11 : month = "Dec"; break;
                  }
    date = today.getDate();
    day = today.getDay();
    switch (day) {
                  case 0 : day = "Duminica"; break;
                  case 1 : day = "Luni"; break;
                  case 2 : day = "Marti"; break;
                  case 3 : day = "Miercuri"; break;
                  case 4 : day = "Joi"; break;
                  case 5 : day = "Vineri"; break;
                  case 6 : day = "Sambata"; break;
                  }
    hours = today.getHours();
       if (hours<12)  greeting = 'Buna dimineata!';
         if (hours<18 && hours>11)  greeting = 'Buna ziua!';
         if (hours<20 && hours>17)  greeting = 'Buna seara!';
         if (hours>19)  greeting = 'Noapte buna!  (working late?)';
    hour = (hours>12) ? (hours-12) : hours;
    halfDay = (hours>11 && hours<24) ? 'PM' : 'AM';
    minutes = today.getMinutes();
    dayStr =  day+ ', ' +date+ ' ' +month+ ', ' +year;
    timeStr = (minutes<10) ? hour+ ':0' +minutes+ ' ' +halfDay : hour+

    ':' +minutes+ ' ' +halfDay;

    // -->
    </script>
    <script language="JavaScript" type="text/javascript">
    <!--
    document.writeln('Astazi este ' +dayStr+ '.<br>Ora este: '

    +timeStr+ '.<br>');document.write(greeting+ '<br>');
    // -->
    </script>


    By Mihaitza
     
    • Page 1 of 1
    • 1
    Search: