tags:

views:

53

answers:

1

I am getting a headache from dealing with the data format, particulary the time offset components.

  1. I retrieve a DateTime field from sqlite3 and temporarily store it in a const char*.
  2. I convert this into an NSString*.
  3. I conver the NSString* to a NSDate.

Now, before, I was using a date format something like this: "MM/dd/YYY hh:mm -0700"

Note that at the time i didnt know why it wouldnt work unless i added some time offset (the -0700 part). And now I atleast understand this is a timezone thing. I believe what im looking for is to be able to work with UTC time.

Basically the issue i'm seeing is that im losing time component here during a database write/read (app restart). Somewhere im losing information about the time. And my theory is that this can be eliminated if I am able to work with UTC time.

Anyone know how???

A: 

i looked at the nsdate documentation for details. it seemed to have done the trick. the date format has to be what im feeding it. although this does raise a question/concern regarding formatting based on the users uiculture/region, i will call this thread closed, for now.

AlvinfromDiaspar