-4

Googing for this seems impossible (obviously the mod was unable to read this correctly. I have bolded the issue to make it more obvious for those who's glasses prescription is off).

Are there any classes for taking an epoch date and displaying it "pretty" similar to facebook. So instead of a static date "8-20-13 5:23pm", it would be "2 hours from now", or "2 days" etc. I don't think it would terribly hard just time consuming to write. Anyone seen a simple class to deal with this?

Update: The answer for this is simple and Nick noted it below. Use the class DateInterval(). Without knowing the name of this class no combo of php, date and formating gets anything but using Date() in google.

4

1 回答 1

1

使用DateInterval并根据需要对其进行格式化。

于 2013-08-05T19:32:56.200 回答