Monday, February 21, 2011

How to store short date format to db?

I use Core Data and I want to store this formatted date to db, field type is date, how can I do this?

date formatted: 2010-10-31

I hope I explained my scenario. Sorry for my English. Greetings.

From stackoverflow
  • The real question here is why you would want to do this. It is best to store the NSDate as an NSDate, then apply any view changes you need on the fly with NSDateFormatter.

    However, so I can get some Rep Points, I will answer the question. You can store the pre-formatted date as an NSString, not an NSDate.

0 comments:

Post a Comment