EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

PHP Date Time Functions

Home » Software Development » Software Development Tutorials » PHP Tutorial » PHP Date Time Functions

PHP Date Time Functions

Introduction to PHP Date Time Functions

PHP Date Time Functions are the inbuilt functions which can simplify the working of the date data types which can help in transforming the date or the time into one human-readable format in order to display the data of the article which is going to be published and the time function will help in returning the timestamp (Numeric value/values in seconds between the current value time and the time which is at Greenwich Mean Time(GMT value which is as at 1970, 1st January 00:00:00)) in the UNIX format.

Types of PHP Date Time Functions

PHP’s date or time functions are a part of the PHP core programming language. So you don’t need any extensions in order to use all the date/time functions. Check out the different types of PHP Date/Time Functions briefly below:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

List of the Date Time Functions of PHP Programming Language:

1. checkdate(): This function will let us validate a Gregorian data.

2. date_add(): This function will let add days, months, years, hours, minutes  and also seconds to the date.

3. date_create_from_format(): The above date time function will return a Date Time Object formatted which is new according to the specific format.

Popular Course in this category
PHP Training (5 Courses, 3 Project)5 Online Courses | 3 Hands-on Project | 28+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (5,731 ratings)
Course Price

View Course

Related Courses
Java Servlet Training (6 Courses, 12 Projects)All in One Software Development Bundle (600+ Courses, 50+ projects)

4. date_create(): The date_create() function will return a new DateTime Object

5. date_date_set(): The date_date_set() function will help you to set a new date in PHP programming language.

6. date_default_timezone_get(): The date_default_timezone_get() function will help in returning the default timezone which is used by all the time/date functions.

7. date_default_timezone_set(): The date_default_timezone_set() function will help you in setting the default time zone which can be used by all the Date Time functions.

8. date_diff(): The date_diff() function will return the difference between the two dates in PHP programming language.

9. date_format(): The date_format() function will help in returning the date formatted according to the format which is specified in the PHP programming language.

10. date_get_last_errors(): The date_get_last_errors() function helps in returning the errors/warnings which are found in the date string in PHP programming language.

11. date_interval_create_from_date_string(): The date_interval_create_from_date_string() function will help in setting up the date interval which are from the string’s relative parts in PHP programming language.

12. date_interval_format(): The date_interval_format() function will help in formatting the interval in the PHP programming language.

13. date_isodate_set(): The date_isodate_set() function will help in setting the ISO date in PHP programming language.

14. date_modify(): The date_modify() function will help you in modifying the timestamp in the PHP programming language.

15. date_offset_get(): The date_offset_get() function will help in returning the timezone’s offset in the PHP programming language.

16. date_parse_from_format(): The date_parse_from_format() function will help in returning the associative array with some detailed info about a specific date according to the specified format in PHP programming language.

17. date_parse(): The date_parse() function will help you in returning the associative array with the detailed info regarding a specific/specified date in PHP programming language.

18. date_sub(): The date_sub() function will help in subtracting the days, the months, the years, the hours, the minutes and the seconds form date in PHP programming language.

19. date_sun_info(): The date_sun_info() function will help you in returning the array/arrays which contains the info regarding the sunrise/sunset and also the twilight begin/end which are for a specified day and also for a specified location in PHP programming language.

20. date_sunrise(): The date_sunrise() function will help you in returning the sunrise time for a specified location and the specified date in PHP programming language.

21. date_sunset(): The date_sunset() function will help in returning the sunset time for the specified location and the specified day/date in PHP programming language.

22. date_time_set(): The date_time_set() function will help you in setting the time in PHP programming language.

23. date_timestamp_get(): The date_timestamp_get() function will help in returning the Unix’s timestamp in PHP programming language.

24. date_timestamp_set(): The date_timestamp_set() function will help us in setting the time and date based on the Unix’s timestamp in PHP programming language.

25. date_timezone_get(): The date_timezone_get() function will help in returning the zone of the time which is given from the DateTime Object in PHP programming language.

26. date(): The date() function will help in formatting the local time and date in PHP programming language.

27. getdate(): The getdate() function will help in returning the time/date info/information of the timestamp or the current local time/date.

28. gettimeofday(): The gettimeofday() function will help in returning the current time.

29. gmdate(): The gmdate() function will help in returning the formatted a GMT/UTC time and date.

30. gmmktime(): The gmmktime() function will help for a GMT date by returning the UNIX time

31. gmstrftime(): The gmstrftime() function will help to format a UTC/GMT time and time according to the locale setting/settings.

32. idate(): The idate() function will format the local date/time just as the integer.

33. localtime(): The localtime() function will help us in returning the local system time.

34. microtime(): The microtime() function will help in returning the current Unix timestamp/timestamps with microseconds.

35. mktime(): The mktime() function will help by returning the Unix timestamp for the date.

36. strftime(): The strftime() function formats the local date and/or local time according to the local settings.

37. strptime(): The strptime() function will help in parsing the date/time which is generated strftime().

38. strtotime(): The strtotime() function will help in parsing an English textual datetime into the Unix timestamp.

39. time(): The time() function will help in returning the current time as a Unix timestamp.

40. timezone_abbreviations_list(): The timezone_abbreviations_list() function will help in returning the associative array which contains the DST, offset and also the timezone’s name.

41. timezone_identifiers_list(): The timezone_identifiers_list() function will help in returning the indexed array with also all the time zone identifiers.

42. timezone_locaiton_get(): The timezone_location_get() function will helps in returning the location info/information for the specified time zone.

43. timezone_name_form_abbr(): The timezone_name_form_abbr() function will help in returning the timezone’s name from its abbreviation.

44. timezone_name_get(): The timezone_name_get() function will help in returning the timezone’s name.

45. timezone_offset_get(): The timezone_offset_get() function will help in returning the timezone’s offset from the Greenwich Mean Time (GMT).

46. timezone_open(): The timezone_open() will help in creating the new DateTIme zone’s object.

47. timezone_transitions_get(): The timezone_transitions_get() function will help in returning all the transactions for the timezone.

48. timezone_version_get(): The timezone_version_get() function will help us in returning the time zoned version.

Recommended Articles

This is a guide to PHP Date Time Functions. Here we discuss the introduction and different types of PHP Date Time Functions. You can also go through our other suggested articles to learn more –

  1. Login Page in PHP
  2. Hashing Function in PHP
  3. PHP Filters
  4. Functions in PHP

PHP Training (5 Courses, 3 Project)

5 Online Courses

3 Hands-on Project

28+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
PHP Tutorial
  • Functions
    • Functions in PHP
    • PHP Math Functions
    • PHP Recursive Function
    • PHP String Functions
    • Hashing Function in PHP
    • Date Function in PHP
    • PHP Anonymous Function
    • Calendar in PHP
    • PHP Call Function
    • PHP Pass by Reference
    • PHP ucfirst()
    • PHP ucwords()
    • trim() in PHP
    • isset() Function in PHP
    • PHP replace
    • PHP fpm
    • PHP strpos
    • preg_match in PHP
    • PHP preg_replace()
    • PHP ob_start()
    • PHP Reflection
    • PHP Split String
    • PHP URL
    • PHP preg_match_all
    • PHP strtoupper()
    • PHP preg_split()
    • PHP substr_replace()
    • PHP setlocale()
    • PHP substr_count()
    • PHP Serialize
    • PHP strlen()
    • PHP async
    • PHP Date Time Functions
    • PHP timezone
    • PHP Data Object
    • print_r() in PHP
    • PHP header()
    • PHP strip_tags()
    • PHP chop()
    • PHP MD5()
    • PHP unset()
    • PHP crypt()
    • PHP wordwrap()
    • PHP is_null()
    • PHP strtok()
    • PHP bin2hex()
    • PHP parse_str()
    • PHP levenshtein()
    • PHP addslashes()
    • PHP strtotime
    • PHP sha1()
    • PHP explode()
    • PHP sscanf()
    • PHP require_once
    • PHP Zip Files
    • PHP $_SERVER
    • PHP $_POST
    • PHP Include and Require
    • PHP POST Method
  • PHP Basic
    • Introduction To PHP
    • What is PHP
    • PHP Keywords
    • Advantages of PHP
    • Career In PHP
    • Comments in PHP
    • PHP Commands
    • PHP Frameworks
    • PHP Compiler
    • Variables in PHP
    • PHP Superglobal Variables
    • PHP Versions
    • Object in PHP
    • What is Drupal
    • Top PHP Frameworks
    • WebStorm IDE
    • What is phpMyAdmin?
    • PhpStorm
    • Install phpMyAdmin
    • Phalcon Model
  • Data Types
    • PHP Data Types
    • PHP Integer
    • PHP Booleans
  • Operators
    • PHP Operators
    • Arithmetic Operators in PHP
    • Comparison Operators in PHP
    • Logical Operators in PHP
    • Bitwise Operators in PHP
    • Ternary Operator in PHP
    • PHP String Operators
  • Control Statements
    • Control Statement in PHP
    • PHP if Statement
    • if else Statement in PHP
    • elseif in PHP
    • PHP Switch Statement
    • Continue in PHP
    • Break in PHP
  • Loops
    • PHP Loops
    • For Loop in PHP
    • PHP Do While Loop
    • PHP While Loop
    • While Loop in PHP
    • Foreach Loop in PHP
  • Constructor
    • Constructor in PHP
    • Destructor in PHP
  • State Management
    • Cookie in PHP
    • Sessions in PHP
  • Array
    • What is PHP Array
    • Arrays in PHP
    • 2D Arrays in PHP
    • Associative Array in PHP 
    • Multidimensional Array in PHP
    • Indexed Array in PHP
    • PHP Array Functions
    • PHP unset Array
    • PHP Append Array
    • PHP Array Search
    • PHP Split Array
    • PHP array_push()
    • PHP array_pop()
  • Advanced
    • Overloading in PHP
    • Overriding in PHP
    • Method Overloading in PHP
    • Inheritance in PHP
    • Multiple Inheritance in PHP
    • PHP Interface
    • Encapsulation in PHP
    • PHP Constants
    • PHP Magic Constants
    • PHP Regular Expressions
    • PHP GET Method
    • PHP Annotations
    • PHP Encryption
    • PHP file Functions
    • PHP readfile
    • PHP?Write File
    • PHP Append File
    • PHP Type Hinting
    • PHP Filters
    • PHP Float
    • PHP Form
    • PHP Form Validation
    • Sorting in PHP
    • PHP usort()
    • PHP Stack Trace
    • PHP Stack Overflow
    • PHP Pagination
    • PHP implode
    • Polymorphism in PHP
    • Abstract Class in PHP
    • PHP Final Class
    • PHP Custom Exception
    • error_reporting() in PHP
    • PHP Log Errors
    • Access Modifiers in PHP
    • PHP Change Date Format
    • Static Method in PHP
    • PHP File Handling
    • PHP Output Buffering
    • Get IP Address in PHP
    • Upload a File in PHP
    • String in PHP
    • Public Function in PHP
    • Private in PHP
    • Protected in PHP
    • basename in PHP
    • Validation in PHP
    • PHP mail()
    • PHP Email Form
    • PHP Directory
    • PHP Create Session
    • PHP include_once
    • PHP json_decode
    • PHP XMLWriter
    • PHP XML Reader
    • PHP XML Parser
    • PHP XML into Array
    • Phalcon Framework
  • Programs
    • Patterns in PHP
    • Star Patterns in PHP
    • Swapping in PHP
    • Fibonacci Series PHP
    • Factorial in PHP
    • Reverse String in PHP
    • Square Root in PHP
    • Random Number Generator in PHP
    • Palindrome in PHP
    • Prime Numbers in PHP
    • Armstrong Number in PHP
    • Socket Programming in PHP
    • Login Page in PHP
    • PHP Login Template
    • PHP Object to String
  • Database
    • PHP Database Connection
    • How to Connect Database to PHP
  • Interview Questions
    • PHP Interview Questions
    • PHP OOP Interview Questions
    • CakePHP Interview Questions
    • Core PHP Interview Questions

Related Courses

PHP Training Course

Java Servlet Training

Software Development Course Training

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - PHP Training (5 Courses, 3 Project) Learn More