CRSDateTime

Objective-C

@interface CRSDateTime : NSObject

Swift

class CRSDateTime : NSObject

Date and time

  • Year

    Declaration

    Objective-C

    @property (nonatomic) int year;

    Swift

    var year: Int32 { get set }
  • Month

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *month;

    Swift

    var month: NSNumber! { get set }
  • day

    Day

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *day;

    Swift

    var day: NSNumber! { get set }
  • Hour

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *hour;

    Swift

    var hour: NSNumber! { get set }
  • Minute

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *minute;

    Swift

    var minute: NSNumber! { get set }
  • Second

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *second;

    Swift

    var second: NSNumber! { get set }
  • Seconds fraction

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDecimalNumber *fraction;

    Swift

    var fraction: NSDecimalNumber! { get set }
  • Seconds fraction Text

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *fractionText;

    Swift

    var fractionText: String! { get set }
  • Local time zone hour

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *timeZoneHour;

    Swift

    var timeZoneHour: NSNumber! { get set }
  • Local time zone minute

    Declaration

    Objective-C

    @property (nonatomic, strong) NSNumber *timeZoneMinute;

    Swift

    var timeZoneMinute: NSNumber! { get set }
  • Parse the text into a Date Time

    Declaration

    Objective-C

    + (CRSDateTime *)parse:(NSString *)text;

    Swift

    class func parse(_ text: String!) -> CRSDateTime!

    Parameters

    text

    date time text

    Return Value

    date time

  • Attempt to parse the text into a Date Time

    Declaration

    Objective-C

    + (CRSDateTime *)tryParse:(NSString *)text;

    Swift

    class func tryParse(_ text: String!) -> CRSDateTime!

    Parameters

    text

    potential date time text

    Return Value

    date time or null

  • Create

    Declaration

    Objective-C

    + (CRSDateTime *)create;

    Swift

    class func create() -> CRSDateTime!

    Return Value

    new instance

  • Initialize

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new instance

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithYear:(int)year;

    Swift

    init!(year: Int32)

    Parameters

    year

    year

    Return Value

    new instance

  • Is an ordinal day

    Declaration

    Objective-C

    - (BOOL)isOrdinal;

    Swift

    func isOrdinal() -> Bool

    Return Value

    true if ordinal day

  • If date has a time precision

    Declaration

    Objective-C

    - (BOOL)hasTime;

    Swift

    func hasTime() -> Bool

    Return Value

    true if has time

  • Check if has a month

    Declaration

    Objective-C

    - (BOOL)hasMonth;

    Swift

    func hasMonth() -> Bool

    Return Value

    true if has month

  • Check if has a day

    Declaration

    Objective-C

    - (BOOL)hasDay;

    Swift

    func hasDay() -> Bool

    Return Value

    true if has day

  • Check if has a hour

    Declaration

    Objective-C

    - (BOOL)hasHour;

    Swift

    func hasHour() -> Bool

    Return Value

    true if has hour

  • Check if has a minute

    Declaration

    Objective-C

    - (BOOL)hasMinute;

    Swift

    func hasMinute() -> Bool

    Return Value

    true if has minute

  • Check if has a second

    Declaration

    Objective-C

    - (BOOL)hasSecond;

    Swift

    func hasSecond() -> Bool

    Return Value

    true if has second

  • Check if has a fraction

    Declaration

    Objective-C

    - (BOOL)hasFraction;

    Swift

    func hasFraction() -> Bool

    Return Value

    true if has fraction

  • Has a time zone hour

    Declaration

    Objective-C

    - (BOOL)hasTimeZoneHour;

    Swift

    func hasTimeZoneHour() -> Bool

    Return Value

    true if has time zone hour

  • Has a time zone minute

    Declaration

    Objective-C

    - (BOOL)hasTimeZoneMinute;

    Swift

    func hasTimeZoneMinute() -> Bool

    Return Value

    true if has time zone minute

  • Is the time zone UTC

    Declaration

    Objective-C

    - (BOOL)isTimeZoneUTC;

    Swift

    func isTimeZoneUTC() -> Bool

    Return Value

    true if UTC

  • Set the time zone as UTC

    Declaration

    Objective-C

    - (void)setTimeZoneUTC;

    Swift

    func setTimeZoneUTC()