Saturday, June 28, 2014

India date and time in php

India date & time can get by setting indian zone and using date function of php. Use Below code

<?php

date_default_timezone_set('Asia/Calcutta');
echo date("H:i");
echo date("d-M-Y");

?>

Friday, June 27, 2014

How to get two date which in varchar type is equal are not in PHP

Suppose we have two date field or two date from SQL result and we want to find out if the eual or not, then you can try below cod code
if ( strtotime($date1) == strtotime($date2) )
{
 echo "date is equal";
}