-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNSDateFormatter+cache.h
More file actions
61 lines (53 loc) · 1.96 KB
/
NSDateFormatter+cache.h
File metadata and controls
61 lines (53 loc) · 1.96 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// NSDateFormatter+cache.h
//
// Created by Jonathan Dalrymple on 25/11/2013.
// Copyright (c) 2014 Float-Right Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDateFormatter (FRDateFormatter_cache)
/**
* Format a date as a string. The date formatter is cached
* @param aFormat A String format
* @param aDate A Date to format
* @return The formatted string
*/
+ (NSString *)stringWithFormat:(NSString *)aFormat
date:(NSDate *)aDate;
/**
* Format a date as a string. The date formatter is cached
* @param aFormat A String format
* @param timezoneName The timezone name ie. UTC
* @param localeIdentifier The locale identifier ie. en_US
* @param aDate A Date to format
* @return The formatted string
*/
+ (NSString *)stringWithFormat:(NSString *)aFormat
timezone:(NSString *)timezoneName
locale:(NSString *)localeIdentifier
date:(NSDate *)aDate;
/**
* Parse a string into a date, the date formatter is cached
* @param aFormat A String format
* @param aDateString A Date to string to parse
* @return The date parsed with the format string
*/
+ (NSDate *)dateWithFormat:(NSString *)aFormat
string:(NSString *)aDateString;
/**
* Parse a string into a date, the date formatter is cached
* @param aFormat A String format
* @param timezoneName The timezone name ie. UTC
* @param localeIdentifier The locale identifier ie. en_US
* @param aDateString A Date to string to parse
* @return The date parsed with the format string
*/
+ (NSDate *)dateWithFormat:(NSString *)aFormat
timezone:(NSString *)timezoneName
locale:(NSString *)localeIdentifier
string:(NSString *)aDateString;
/**
* Causes the internal cache of date formatters to be cleared when the current locale changes
*/
+ (void)clearCachedDateFormattersWhenCurrentLocaleChanges;
@end