search
top

Set Default Time Zone

Some of you may have faced the issue for converting timezone for displaying date and time. Means suppose you want to display current time in India, than what will you do for that. You might have added 5 hours and 30 minutes to the default time. But there is already a functionality for that in PHP. You can switch the timezone as per your requirement. For example, You get default time by <?php echo...
read more

List Date Difference

Some of you might have come across the requirement for displaying all the dates between give two dates, especially for drop down listing of dates. I have developed a sample code for getting all date ocurrences between give two dates. <?php $fromDate = "01/01/2009"; //format mm/dd/yyyy $toDate = "01/25/2010"; //format mm/dd/yyyy $dateMonthYearArr = array(); $fromDateTS = strtotime($fromDate); $toDateTS...
read more

top