yii: default value for date picker field and CJuiDatePicker

by prettyscripts on 2012-01-24 14:28:00 • Leave a comment »

phpyii

setting a default date value to a date picker field is not so straightforward. as in, simply set a property for the CJuiDatePicker widget. there are 2 ways to do it. these are based on some forum posts i found a while ago. method 1 - give the attribut… more »

Tags: date, default, php, yii

php: date difference in days

by prettyscripts on 2010-02-19 11:19:00 • 2 comments »

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