Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Ultimo giorno del mese

  1. #1

    Ultimo giorno del mese

    Domanda flash
    C'è un modo umano per conoscere al volo il numero dell'ultimo giorno del mese?
    Oppure bisogna partire con 31, passare giorno/mese/anno a checkdate, verificare, se non va bene passare 30 eccc eccc???
    Argh
    Grazie e ciao

  2. #2
    un attimo...modifico il post quando ho trovato

    edit
    Codice PHP:
    $giornimese date("t"time()); 
    // Number of days in the given month 

  3. #3
    ma porka di quella *%$ç$$&$%$%$$
    lo sapevo che era facile...

    Grazie mille!

  4. #4
    passare time() come secondo parametro non serve, la funzione date() usa di default il tempo attuale se non viene specificato diversamente.

  5. #5
    Utente di HTML.it L'avatar di chris
    Registrato dal
    Sep 1999
    Messaggi
    1,568
    http://it.php.net/mktime
    Example 2. Last day of next month

    The last day of any given month can be expressed as the "0" day of the next month, not the -1 day. Both of the following examples will produce the string "The last day in Feb 2000 is: 29".
    <?php
    $lastday = mktime(0, 0, 0, 3, 0, 2000);
    echo strftime("Last day in Feb 2000 is: %d", $lastday);
    ?>

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.