date_parse() function • How To Split Date and Time in PHP

There is function date_parse() in PHP. It splits date and time and returns an associative array. Now, easily We can get the day, month, hours, etc. separately by using the key names. date_parse() function example Print all extracted data by loop as key value pair date_parse() function also returns some arrays. Therefore, you will get … Read more

timezone_identifiers_list() function ~ Print Timezones List in PHP

The function timezone_identifiers_list() returns an array that contains all the timezone (almost 426). So you can print them by accessing indexing numbers. Here I am going to print all the timezone with the help of a loop. See example below. Print all the timezone list using foreach() loop calculation to current and custom date & … Read more

strtotime() function: Calculation to Current Date and Time & Custom Date and Time in PHP

The strtotime() function returns the current date and time. Besides, returning the current date it also can be used for creating custom date and time. By using this function, we can add or remove days, weeks, years & months or hours, minutes & seconds to custom date and time or current date and time We … Read more

date_add() ~ How To Add Days, Months and Years in a Custom Date in PHP?

Php gives a function for calculating days, months and years on a custom date. The method is date_add(). You can add days or months or years to a date in round figure. Table of Contents || Add days to a date in PHP in round figure|| Add months to a date|| Add years to a … Read more

cal_days_in_month() • How To Get the Number of Days in any Month of any Year?

The cal_days_in_month() function returns the number of days in a specific month of a year. This is the predefined function of PHP. cal_days_in_month() function syntax Example : – Know all the number of days in any year Print all the months’ name two dates differences Get current date and time in PHP

diff(): How To Get the Differences Between Two Dates in Days, Year & Month in PHP

The predefined method of PHP – diff() lets us calculate the difference between two dates. We can get the difference between the days of two dates, two months and also two years. This method is used as a method of the object because first, we store first date in a variable and then in that … Read more

date_create() function • Custom Date in PHP

The date_create() function of PHP is very useful when we want to create an arbitrary custom date. The date() function of PHP is for the current date and time but date_create() used to create any custom date. Whereby we can know the day name on a particular date, was that a leap year, months name, … Read more