কম্পিউটার টিউটোরিয়াল

PHP-এ date_default_timezone_get() ফাংশন


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

  1. PHP-তে touch() ফাংশন

  2. PHP-তে filemtime() ফাংশন

  3. PHP-তে filectime() ফাংশন

  4. PHP-তে fileatime() ফাংশন