Starting with a unix timestamp like 1290529723, how would I (assuming gmt) get the information on whether it is:
-
today (if so, what time)
-
in the last seven days (if so, which day … mon,
tues etc?) - older than a week (if so, how to output in dd/mm/yy
format?)
I need this for a list of messages like the iPhone’s Mail app, where date/times are shown relative to the current date and time, like so:
15:45
Yesterday
Sunday
Saturday
10/10/10
etc
I made this method to change the unix time stamp into a nice readable, relative string. Probably doesn’t work properly in the first few days of a new year, but hopefully you should be too hungover to notice.