-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMKUtil_DateTime.h
More file actions
47 lines (29 loc) · 979 Bytes
/
Copy pathMKUtil_DateTime.h
File metadata and controls
47 lines (29 loc) · 979 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// MKUtil_DateTime.h
//
//
// Created by m3kwong on 2013-05-26.
// Copyright (c) 2013 Mark Kwong. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MKUtil_DateTime : NSObject
/** Returns a string in the format yyyy-MM-dd HH:mm:ss from a NSDate object
*/
+(NSString *) getDateTimeString:(NSDate *)now;
/** Returns a string of hr:min from an NSTimeInterval
*/
+(NSString *) getAmountOfTimeFromTimeInterval:(NSTimeInterval)interval;
/** Returns a NSDate object from day, month and year
@param day
@param month
@param year
*/
+(NSDate *) nsdateFromDateComponents:(NSInteger)day
month:(NSInteger)month
year:(NSInteger)year;
/** Extracts day, month and year from a NSDate object
@param date The date to extract components
*/
+(NSDateComponents *)dayMonthYearComponentFromNsdate:(NSDate *)date;
+(NSDate *)nsdateFromDateComponents:(NSDateComponents *)comp;
@end