NSMetadataQuery and NSDate: precision problem
I was using NSMetadataQuery to find files开发者_Go百科 which creation date is more recent than a NSDate. It seems that NSMetadataQuery cannot find files which creation date is more recent than the specified NSDate for one hour. I mean if the creation date of a file is today at 12:10:50, the query return no result if I set today 11:10:49 as NSDate, while found the file if I set today at 11:10:51.
Can someone explain me why and how can I solve it?
After a bit of testing, it seems the problem is caused by daylight saving time. When I first tried the program, we were in daylight saving time and that caused the imprecision. Later I tried the code in winter time and it works perfectly. I submitted a bug to Apple but they didn't answered yet...
精彩评论