Date to unix timestamp
Friday , 25 May, 2018 00:29:53 | GMT (Time zone: UTC)
Unix timestamp to date
What is unix timestamp?
Unix timestamp is the number of seconds since january 1, 1970 00:00:00 GMT.
How do we get timestamp in PHP?
Using strtotime() function we can get unix timestamp. it is also very important to note that strtotime() requires a default timezone otherwise it will generate timestamp in server timezone which could be misleading.
PHP Code Example:How do we get readable date from timestamp?
We can use date() function to generate readable date.
PHP Code Example: