Core Data, get records by date, regardless the time

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

  1. willemVP macrumors newbie

    Joined:
    Aug 4, 2011
    #1
    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

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

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

Share This Page