PHP
How To Convert Timestamp To Date in PHP

How To Convert Timestamp To Date in PHP

By: SolutionsHint    29 views Updated: 27th Jan, 2018
How To Convert Timestamp To Date in PHP

Hello everyone in this tutorial I will explain How TO Convert Timestamp To Date in PHP, before starting a convert from timestamp to a date, we should know about what is a timestamp and why we used a timestamp in any web application for managing the detail. 

so whenever you have any timestamp then you can easily convert from timestamp to human readable format using PHP in-built function date(), date function always converts any timestamp to a readable format.

How TO Convert Timestamp To Date in PHP

Output:

Explain time() function return the current local time in an integer like 192928837 in seconds, and its non-human readable format, so to make it human readable format we need to convert it like “26 – Jan – 2018“. We will use date() function to convert to exact format in which we want.

d: day of month

M: capital M return month name in three characters only like( Jan, Feb, Mar) if you want to return full name of the month you may use a capital “M“.

y:  small y return the year in two digits like 18, if you want to return full name of the year like 2018, use Capital “M”.

About the Author

I am a professional blogger from my heart, I am going through all the possible ways that can help to audience. I am trying my best to write content that my readers will like me. I will really be happy when my readers will become more happy with my blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

Tweet
Share
+1
Share
0 Shares