DBNSDateSerializer

Objective-C

@interface DBNSDateSerializer : NSObject

Swift

class DBNSDateSerializer : NSObject

Serializer functions used by the SDK to serialize/deserialize NSDate types.

  • Returns a json-compatible NSString that represents an NSDate type based on the supplied NSDate object and date format string.

    Declaration

    Objective-C

    + (nonnull NSString *)serialize:(nonnull NSDate *)value
                         dateFormat:(nonnull NSString *)dateFormat;

    Swift

    class func serialize(_ value: Date, dateFormat: String) -> String
  • Returns an NSDate object from the supplied NSString-representation of an NSDate object and the supplied date format string.

    Declaration

    Objective-C

    + (nonnull NSDate *)deserialize:(nonnull NSString *)value
                         dateFormat:(nonnull NSString *)dateFormat;

    Swift

    class func deserialize(_ value: String, dateFormat: String) -> Date