PHP Function: Built-in Functions part 4

Today we will look at some Date and Time functions.

date() 
The date() function returns the current server timestamp, formatted according to to a given set of parameters. Its syntax is
date(format, [timestamp]);
The date() Function Formats are located at https://techsoftcenter.com/articles.php?view=238

checkdate() 
The checkdate() function validates a given date. Successful validation means that the year is between 0 and 32767, the month is between 1 and 12, and the proper number of days are in each month (leap years are accounted for). Its syntax is
checkdate(month, day, year);

mktime() 
The mktime() function returns the UNIX timestamp as a long integer (in the format of seconds since the Epoch) for a given date. Thus, the primary use of mktime() is to format dates in preparation for mathematical functions and date validation. Its syntax is
mktime(hour, minute, second, month, day, year);

time() and microtime() 
The time() function returns the current system time, measured in seconds since the Epoch. The syntax of time() is simply
time();
You could get a result such as 958950466.

Using microtime() adds a count of microseconds, so instead of just receiving a result like 958950466, you would get a result like 0.93121600 958950466, at the exact moment you asked for the time since the Epoch (this includes both seconds and microseconds).

That’s all for tody…Next php function: Built-in Functions part 5