Core Data, get records by date, regardless the time

Discussion in 'iOS Programming' started by willemVP, Oct 19, 2011.

  1. willemVP macrumors newbie

    Aug 4, 2011
    I have a project that uses RestKit & Core Data to manage my data.
    What I'm trying to do is to get all the records for a specified date regardless the time. I have a Data attribute in Core Data which has dates stored like 2011-11-14 13:30:00. I don't care about the time for now, I only want the records with the same date as 2011-11-14.

    How do I do this?
  2. amorya macrumors 6502

    Jun 17, 2007
    Date >= 2011-11-14 00:00 && Date < 2011-11-15 00:00
  3. willemVP thread starter macrumors newbie

    Aug 4, 2011
    That's how I fixed for now. But isn't there an easier way like: day(myDate) == day(myCompareDate)?

Share This Page