php: date difference in days

by prettyscripts on 2010-02-19 11:19:00 • Leave a comment »

php

there are a few ways to calculate how many days between 2 given dates. the following examples calculates how many days to x'mas from today (19/2/10).method 1 using gregoriantojd($month, $day, $year) function to find out the julian day count. withou… more »

Tags: date, day, php

php: get next month

by prettyscripts on 2008-02-01 09:00:31 • Leave a comment »

php

to get next month it should be as simple as: date("n", mktime(0, 0, 0, $month + 1)); according to one of the comments in mktime, an incorrect month returns if the month you’re trying to get has less number of days than the current month. to fix,… more »

Tags: date, mktime, month, php