forked from mwaterfall/MWFeedParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNSDate+InternetDateTime.h
More file actions
31 lines (25 loc) · 899 Bytes
/
NSDate+InternetDateTime.h
File metadata and controls
31 lines (25 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// NSDate+InternetDateTime.h
// MWFeedParser
//
// Created by Michael Waterfall on 07/10/2010.
// Copyright 2010 Michael Waterfall. All rights reserved.
//
#import <Foundation/Foundation.h>
// Formatting hints
typedef enum {
DateFormatHintNone,
DateFormatHintRFC822,
DateFormatHintRFC3339
} DateFormatHint;
// A category to parse internet date & time strings
@interface NSDate (InternetDateTime)
// Get date from RFC3339 or RFC822 string
// - A format/specification hint can be used to speed up,
// otherwise both will be attempted in order to get a date
+ (NSDate *)dateFromInternetDateTimeString:(NSString *)dateString
formatHint:(DateFormatHint)hint;
// Get date from a string using a specific date specification
+ (NSDate *)dateFromRFC3339String:(NSString *)dateString;
+ (NSDate *)dateFromRFC822String:(NSString *)dateString;
@end