{"id":2059,"date":"2013-11-21T17:00:36","date_gmt":"2013-11-21T08:00:36","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2059"},"modified":"2013-11-21T17:40:01","modified_gmt":"2013-11-21T08:40:01","slug":"isequaltodate-%e3%81%a8-nsdatefommatter","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2059","title":{"rendered":"isEqualToDate \u3068 NSDateFommatter"},"content":{"rendered":"<p>NSDate\u578b\u306b\u3001\u6642\u9593\u304c\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308b\u3002<br \/>\n(BOOL)isEqualToDate:(NSDate *)anotherDate<br \/>\n\u3057\u304b\u3057\u3001\u5f53\u7136\u306e\u3053\u3068\u306a\u304c\u3089\u30011\u79d2\u3067\u3082\u6570\u5024\u304c\u7570\u306a\u308b\u3068\u3001\u65e5\u4ed8\u5224\u5b9a\u304c\u7570\u306a\u3063\u3066\u3057\u307e\u3046\u3002\u306a\u306e\u3067\u3001NSString\u578b\u3067\u6bd4\u8f03\u3002<\/p>\n<p>[c]<br \/>\n    NSDateFormatter *fmt = [[NSDateFormatter alloc]init];<br \/>\n    [fmt setDateFormat:@&quot;yyyy\/MM\/dd&quot;];<br \/>\n    NSString *currentDate = [fmt stringFromDate:[NSDate date]];<br \/>\n    NSString *tommorowDate = [fmt stringFromDate:[NSDate dateWithTimeIntervalSinceNow:60*60*8]];<\/p>\n<p>    NSLog(@&quot;\u73fe\u5728:%@&quot;, currentDate);<br \/>\n    NSLog(@&quot;\u660e\u65e5:%@&quot;, tommorowDate);<\/p>\n<p>    if ([currentDate isEqualToString: tommorowDate]) {<br \/>\n        NSLog(@&quot;\u540c\u65e5\u3067\u3059\u3002&quot;);<br \/>\n    }else{<br \/>\n        NSLog(@&quot;\u540c\u65e5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002&quot;);<br \/>\n    }<\/p>\n<p>[\/c]<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001NSString\u578b\u540c\u58eb\u3067\u3001== \u3067\u6bd4\u8f03\u3059\u308b\u3068 false\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n[c]<br \/>\n    if (currentDate == tommorowDate) {<br \/>\n        NSLog(@&quot;\u540c\u65e5\u3067\u3059\u3002%@&quot;, result);<br \/>\n    }else{<br \/>\n        NSLog(@&quot;\u540c\u65e5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002%@&quot;, result);<br \/>\n    }<br \/>\n[\/c]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NSDate\u578b\u306b\u3001\u6642\u9593\u304c\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308b\u3002 (BOOL)isEqualToDate:(NSDate *)anotherDate \u3057\u304b\u3057\u3001\u5f53\u7136\u306e\u3053\u3068\u306a\u304c\u3089\u30011\u79d2\u3067\u3082\u6570\u5024\u304c\u7570\u306a\u308b\u3068\u3001\u65e5\u4ed8\u5224\u5b9a\u304c\u7570\u306a\u3063\u3066\u3057\u307e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[38,4],"tags":[],"class_list":["post-2059","post","type-post","status-publish","format-standard","hentry","category-objective-c","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2059"}],"version-history":[{"count":2,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions"}],"predecessor-version":[{"id":2061,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions\/2061"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}