Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Display Dates Like Mail App

DenVogDenVog Posts: 625Registered Users
Is there an existing method to convert dates so that they will display like Apple's iPhone Mail app? Examples:
  • Posted today, then it displays "9:44 AM"
  • Posted yesterday, it displays "Yesterday"
  • Posted more than a day ago, it displays the appropriate weekday "Tuesday"
  • More than a week ago the short date "6/16/09"
Right now, I'm receiving the time and date format as defined in RFC822. For example: "Sun, 06 Sep 2009 16:10:34 +0000".

Since date use is pretty common, I'd like to think that Apple has a pre-rolled function for this but I've not found it. If not, then I guessing I'd need to:
[LIST=1]
[*]Convert this input date to Apple's format pattern
[*]Create a calendar
[*]Calculate the delta between the input date and current time
[*]Do a bunch of if/then statements to tell it how to display the date to user
[/LIST]

Examples and/or pointers greatly appreciated.
Post edited by DenVog on
Index Card | Comic Viewer | <a href="http://click.linksynergy.com/fs-bin/stat?id=e*p82eCraXo&offerid

Replies

Sign In or Register to comment.