I'm basically trying to convert a Unix timestamp (the time() function) to a relative date/time that's both compatible with past and future date. So outputs could be:
2 weeks ago
1 hour and 60 minutes ago
15 minutes and 54 seconds ago
after 10 minutes and 15 seconds
First I tried to code this, but made a huge unmaintainable function, and then I searched the internet for a couple of hours, yet all I can find are scripts that produce only one part of the time (e.h: "1 hour ago" without the minutes).
Do you have a script that already does this?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…