I have read date from XML which give me back string where the date is like DD-MM-YYYY
. But when I want to add it to my core data database, SQLite sorts me that wrong so I have to convert it to date format or to string like: YYYY-MM-DD
. But SQLite does not support either Date()
or To_Date()
functions. Can you help me?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- SQL/SQL-LITE - Counting records after filtering
- iOS (objective-c) compression_decode_buffer() retu
You can use NSDateFormatter to format a date in Objective C.
Here's a quick example which might not do exactly what you want, but should hopefully give some pointers:
Hope this helps!
Nick.
Using Nick's tutorial and answer the solution is :