Help with date function

    Date: 06/23/05 (PHP Community)    Keywords: no keywords

    OK, I know I have the months right, but I am unssure about the year. Will this work when the next or last month is in a different year?



    $NextMonth = date("m", mktime(0, 0, 0, $Month+1, 1, $Year));
    $NextYear = date("Y", mktime(0, 0, 0, $Month+1, 1, $Year));

    $LastMonth = date("m", mktime(0, 0, 0, $Month-1, 1, $Year));
    $LastYear = date("Y", mktime(0, 0, 0, $Month-1, 1, $Year));

    Source: http://www.livejournal.com/community/php/311468.html

« i need some help || Transfer variables. »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home