date_default_timezone_get() ফাংশনটি ডিফল্ট টাইম জোন রিটার্ন করে।
সিনট্যাক্স
date_default_timezone_get(void)
প্যারামিটার
void − NA
রিটার্ন
date_default_timezone_get() ফাংশনটি একটি স্ট্রিং রিটার্ন করে।
উদাহরণ
নিচে একটি উদাহরণ দেওয়া হলো −
<?php
echo "Old time zone is " . date_default_timezone_get();
$timeZone = 'America/Costa_Rica';
if (date_default_timezone_set($timeZone)) {
// এখন এই টাইম জোন পান।
echo "New time zone is " . date_default_timezone_get();
}
?>
আউটপুট
Old time zone is UTC New time zone is America/Costa_Rica
উদাহরণ
আরেকটি উদাহরণ দেখি −
<?php echo date_default_timezone_get(); ?>
আউটপুট
UTC