Latest news:
Sahih al-Bukhari (সহীহ বুখারী) is a free Hadith application for android. This application is advertisement free. Download now https://play.google.com/store/apps/details?id=com.akramhossin.bukharisharif
PHP DateTime class provides all the date and time processing functionality.
The DateTimeZone class provides DateTime objects with all the required time zone information.
DateTimeZone require the timezone name as string format and it will return an object representing datetime of that particular time zone.
We need to follow these steps to convert any datetime to particular time zone:
function getSiteTime($timestamp="") {
$dtzone = new DateTimeZone('Europe/Paris');
$time = date('r', $timestamp);
$dtime = new DateTime($time);
$dtime->setTimeZone($dtzone);
$time = $dtime->format('m-d-Y, a\t g.i A');
return $time;
}
To get the time call the function like echo getSiteTime(time())
Views : 1164