PHP Date / Time Functions

PHP Date/Time Introduction

Date/Time functions allow you to get the date and time from the server where the PHP script is running. You can use Date/Time functions to format the date and time in different ways.

Note:These functions depend on the local settings of the server. Remember to consider daylight saving time and leap years when using these functions.

Installation

PHP Date/Time functions are an integral part of PHP core. These functions can be used without installation.

Runtime Configuration

The behavior of Date/Time functions in PHP 5 is affected by the settings in php.ini:

Name বর্ণনা Default PHP Version
date.timezone Default Time Zone (all Date/Time functions use this option) "" PHP 5.1
date.default_latitude Default Latitude (date_sunrise() and date_sunset() use this option) "31.7667" PHP 5.0
date.default_longitude Default Longitude (date_sunrise() and date_sunset() use this option) "35.2333" PHP 5.0
date.sunrise_zenith Default Sunrise Zenith (date_sunrise() and date_sunset() use this option) "90.83" PHP 5.0
date.sunset_zenith Default Sunset Zenith (date_sunrise() and date_sunset() use this option) "90.83" PHP 5.0

PHP 5 Date/Time Function

ফাংশন বর্ণনা
checkdate() গ্রিগরীয় তারিখ পরীক্ষা করুন
date_add() তারিখে দিন, মাস, বছর, সেকেন্ড, মিনিট ও সেকেন্ড যোগ করুন
date_create_from_format() নির্দিষ্ট ফরম্যাট অনুযায়ী নতুন DateTime অবজেক্ট ফিরিয়ে দিন
date_create() নতুন DateTime অবজেক্ট ফিরিয়ে দিন
date_date_set() নতুন তারিখ সেট করুন
date_default_timezone_get() সকল Date/Time ফাংশন ব্যবহারের জন্য ডিফল্ট টাইমজোন ফিরিয়ে দিন
date_default_timezone_set() সকল Date/Time ফাংশন ব্যবহারের জন্য ডিফল্ট টাইমজোন সেট করুন
date_diff() দুই তারিখের মধ্যের মাত্রা ফিরিয়ে দিন
date_format() নির্দিষ্ট ফরম্যাট অনুযায়ী ফরম্যাট করা তারিখ ফিরিয়ে দিন
date_get_last_errors() তারিখ স্ট্রিং-এর সংশ্লিষ্ট অংশ থেকে সতর্কতা/ত্রুটি ফিরিয়ে দিন
date_interval_create_from_date_string() স্ট্রিং থেকে সময় সময়কাল তৈরি করুন
date_interval_format() সময় সময়কাল ফরম্যাট করুন
date_isodate_set() ISO তারিখ সেট করুন
date_modify() টাইমস্ট্যাপ সংশোধন করুন
date_offset_get() টাইমজোন অফসেট ফিরিয়ে দিন
date_parse_from_format() নির্দিষ্ট ফরম্যাট অনুযায়ী নির্দিষ্ট তারিখের বিস্তারিত তথ্য ধারণকারী এসোসিয়েটেড অ্যারে ফিরিয়ে দিন
date_parse() নির্দিষ্ট তারিখের বিস্তারিত তথ্য ধারণকারী এসোসিয়েটেড অ্যারে ফিরিয়ে দিন
date_sub() নির্দিষ্ট তারিখ থেকে দিন, মাস, বছর, সেকেন্ড, মিনিট ও সেকেন্ড হারান
date_sun_info() নির্দিষ্ট তারিখ ও স্থানের সাথে সূর্যাস্ত/সূর্যউদয় ও সাম্যকালীন শুরু/শেষ সময়ের তথ্য ধারণকারী আইটেম ফিরিয়ে দিন
date_sunrise() নির্দিষ্ট তারিখ ও স্থানের সাথে সাম্যকালীন সূর্যউদয় সময় ফিরিয়ে দিন
date_sunset() নির্দিষ্ট তারিখ ও স্থানের সাথে সাম্যকালীন সূর্যাস্ত সময় ফিরিয়ে দিন
date_time_set() সময় সেট করুন
date_timestamp_get() ইউনিক্স টাইমস্ট্যাপ ফিরিয়ে দিন
date_timestamp_set() ইউনিক্স টাইমস্ট্যাপের ভিত্তিতে তারিখ ও সময় সেট করুন
date_timezone_get() নির্দিষ্ট DateTime অবজেক্টের টাইমজোন সেট করুন
date_timezone_set() DateTime অবজেক্টের সময়ক্ষেত্র সেট করে।
date() স্থানীয় তারিখ এবং সময় ফরম্যাটিং করে।
getdate() কোনো সময়সূচক বা বর্তমান স্থানীয় তারিখ/সময় তথ্য ফিরিয়ে দেয়।
gettimeofday() বর্তমান সময় ফিরিয়ে দেয়।
gmdate() GMT/UTC তারিখ এবং সময় ফরম্যাটিং করে।
gmmktime() GMT তারিখের UNIX সময়সূচক ফিরিয়ে দেয়।
gmstrftime() লোকাল সেটিং অনুযায়ী GMT/UTC তারিখ এবং সময় ফরম্যাটিং করে।
idate() স্থানীয় সময়/তারিখকে ইন্টেজ ফরম্যাটে ফরম্যাটিং করে।
localtime() স্থানীয় সময় ফিরিয়ে দেয়।
microtime() বর্তমান সময়ের মাইক্রোসেকেন্ড ফিরিয়ে দেয়।
mktime() তারিখের Unix সময়সূচক ফিরিয়ে দেয়।
strftime() লোকাল সেটিং অনুযায়ী স্থানীয় সময়/তারিখ ফরম্যাটিং করে।
strptime() strftime() দ্বারা তৈরি হওয়া সময়/তারিখ পার্সিং করে।
strtotime() কোনো ইংরেজি লেখার তারিখ এবং সময় বর্ণনা থেকে Unix সময়সূচক পার্সিং করে।
time() বর্তমান সময়ের Unix সময়সূচক ফিরিয়ে দেয়।
timezone_abbreviations_list() সময়ক্ষেত্রের গ্রীষ্মকালীন সময়, স্থানান্তর এবং সময়ক্ষেত্রের নাম ধারণকারী সংযুক্ত আইনপত্র ফিরিয়ে দেয়।
timezone_identifiers_list() সময়ক্ষেত্র পরিচিতির সহ সমস্ত সূচক আইনপত্র ফিরিয়ে দেয়।
timezone_location_get() নির্দিষ্ট সময়ক্ষেত্রের স্থানান্তর তথ্য ফিরিয়ে দেয়।
timezone_name_from_abbr() সময়ক্ষেত্র সংক্ষিপ্ত নাম থেকে সময়ক্ষেত্রের নাম ফিরিয়ে দেয়।
timezone_name_get() সময়ক্ষেত্রের নাম ফিরিয়ে দেয়।
timezone_offset_get() GMT-র প্রতি সময়ক্ষেত্র স্থানান্তর ফিরিয়ে দেয়।
timezone_open() নতুন DateTimeZone অবজেক্ট তৈরি করে।
timezone_transitions_get() সময়ক্ষেত্রের সমস্ত পরিবর্তন ফিরিয়ে দেয়।
timezone_version_get() সময়ক্ষেত্র ডাটাবেসের সংস্করণ ফিরিয়ে দেয়।

PHP 5-র প্রেডিফাইন্ড ডেট/টাইম স্থির

স্থির বর্ণনা
DATE_ATOM Atom (উদাহরণ: 2005-08-15T16:13:03+0000)
DATE_COOKIE HTTP Cookies (উদাহরণ: Sun, 14 Aug 2005 16:13:03 UTC)
DATE_ISO8601 ISO-8601 (উদাহরণ: 2005-08-14T16:13:03+0000)
DATE_RFC822 RFC 822 (উদাহরণ: Sun, 14 Aug 2005 16:13:03 UTC)
DATE_RFC850 RFC 850 (উদাহরণ: Sunday, 14-Aug-05 16:13:03 UTC)
DATE_RFC1036 RFC 1036 (উদাহরণ: Sunday, 14-Aug-05 16:13:03 UTC)
DATE_RFC1123 RFC 1123 (উদাহরণ: Sun, 14 Aug 2005 16:13:03 UTC)
DATE_RFC2822 RFC 2822 (Sun, 14 Aug 2005 16:13:03 +0000)
DATE_RSS RSS (Sun, 14 Aug 2005 16:13:03 UTC)
DATE_W3C ওয়ার্ল্ড ওয়াইড ওয়েব কনসোরশিয়াম (উদাহরণ: 2005-08-14T16:13:03+0000)