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.
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
Hi again. Is anyone able to point me in the right direction or at least confirm I'm on the right path? Is there an Apple method that will perform this (yesterday, today, short date) calculation and display?
Otherwise, it looks like I will pursue using timeIntervalSinceNow to check against current date and do a bunch of if/then statements (less 24 hours display time, else less than 48 hours "yesterday", etc.). Seems a little involved for what I want to do, and given I'm pretty new it will take me a fair bit of time. I'd hate to pound through this manually and then find out it already exists!
Any pointers appreciated.
Index Card | Comic Viewer | <a href="http://click.linksynergy.com/fs-bin/stat?id=e*p82eCraXo&offerid
Personally, it sounds like it would be an interesting task to write this code. Why not view it as a challenge? :)
Ha ha. I am new to programming, so I don't have any shortage of challenges. :p I don't mind figuring it out if that's what it takes. I just don't want to reinvent the wheel or find out I did it the hard way. iPhone is not my day job, so the less time I spend on this feature the more time I can devote to other "challenges". :D
Index Card | Comic Viewer | <a href="http://click.linksynergy.com/fs-bin/stat?id=e*p82eCraXo&offerid
Replies
Otherwise, it looks like I will pursue using timeIntervalSinceNow to check against current date and do a bunch of if/then statements (less 24 hours display time, else less than 48 hours "yesterday", etc.). Seems a little involved for what I want to do, and given I'm pretty new it will take me a fair bit of time. I'd hate to pound through this manually and then find out it already exists!
Any pointers appreciated.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome