With this function, you can convert a mysql datetime datatype into any other format. This way, you only need to declare the function once and be able to format your dates everywhere in your document.
/* The Purpose of this function is to display the actual time in your time zoneif your web host has a different time from you. In the function, the variable $timediff is the time difference in seconds between your actual location and the location of your
Given two dates, you can use this function to calculate the difference between them in terms of the number of years, months, weeks, hours, minutes and seconds.
Displaying the Current Date and Time. All data which may be obtained with command Date() is shown. A couple of examples are included: link of the day and local time
This technique is very helpful when you try to optimize your PHP script. Just add a few lines of PHP code and you will get a report showing execution time of your script in milliseconds.