PHP date_create_from_format() ফাংশন

উদাহরণ

নির্দিষ্ট ফরম্যাট অনুযায়ী ফরম্যাটিং করা নতুন DateTime অবজেক্ট ফিরিয়ে দেয়:

<?php
$date=date_create_from_format("j-M-Y","25-Sep-2016");
?>

চালু করা

বিবরণ ও ব্যবহার

date_create_from_format() ফাংশন নির্দিষ্ট ফরম্যাট অনুযায়ী ফরম্যাটিং করা নতুন DateTime অবজেক্ট ফিরিয়ে দেয়。

ব্যাক্রিয়া

date_create_from_format(format,time,timezone);
পারামিটার বর্ণনা
format

অপরিহার্য। ব্যবহারযোগ্য ফরম্যাট নির্ধারণ করেformat পারামিটার স্ট্রিং নিম্নোক্ত অক্ষরগুলি ব্যবহার করা যেতে পারে:

  • d - মাসের কোন দিন, প্রারম্ভিক শূন্য সহ
  • j - মাসের কোন দিন, প্রারম্ভিক শূন্য ছাড়া
  • D - The day of the week (Mon-Sun)
  • I - The day of the week (Monday-Sunday)
  • S - The suffix of the day of the month in English (st, nd, rd, th)
  • F - Month name (January-December)
  • M - Month name (Jan-Dec)
  • m - Month (01-12)
  • n - Month (1-12)
  • Y - Year (e.g., 2013)
  • y - Year (e.g., 13)
  • a and A - am or pm
  • g - 12-hour format, without leading zero
  • h - 12-hour format, with leading zero
  • G - 24-hour format, without leading zero
  • H - 24-hour format, with leading zero
  • i - Minutes, with leading zero
  • s - Seconds, with leading zero
  • u - Microseconds (up to six digits)
  • e, O, P and T - Time zone identifiers
  • U - Seconds since Unix epoch
  • (空格)
  • # - One of the following delimiters: ;, :, /, ., -, (, )
  • ? - A random byte
  • * - Random bytes until the next delimiter/digit
  • ! - Reset all fields to Unix epoch
  • | - If all fields have not been parsed, reset all fields to Unix epoch
  • + - If trailing data exists in the string, it will cause a warning, not an error
time Required. Specify date/time string. NULL indicates the current date/time.
timezone Optional. Specify time Time Zone. Default is the current time zone.

Technical Details

Return Value: সফল হলে DateTime Object ফিরিয়ে দেয়, ব্যর্থ হলে FALSE ফিরিয়ে দেয়。
PHP Version: 5.3+