A string representing a timestamp in any format that can be recognized by the strtotime function, such as "2022-04-18 10:30:00" or "April 18th, 2022 10:30am".
Returns
Data Type
Description of Returned Data
string
Returns a formatted date string indicating the time difference between the given timestamp and the current time.
Further Documentation:
The function first converts the given timestamp to a Unix timestamp using the strtotime function. Then it calculates the time difference in days between the current time and the given timestamp.
If the time difference is between 0 and 7 days, the function returns a string indicating the time elapsed in days and the time of day (either "Today, HH:MM AM/PM" or the day of the week followed by the time in the same format).
If the time difference is 7 days or greater, the function returns a string indicating the date and time in the format "MMM DD, YYYY HH:MM AM/PM".