IOS基本类方法与实例方法之日期总结
来源:互联网 发布:智阳网络有年终奖吗 编辑:程序博客网 时间:2024/05/29 19:32
method of class
+ data
return value:A new object set to the current date and time (创建一个新的日期对象实例)
+ (instancetype) dateWithTimeIntervalSinceNow:(NSTimeInTerval)seconds
Function:creates and return an NSDate object set to a give number of seconds from the current date and time
retutn value:An NSDate objecet set to seconds from the current date and time(创建一个现在时间和日期的实例)
+ (instancetype)dateWithTimeInterval:(NSTimeInterval)seconds
sinceDate:(NSDate *)date
Function:Creates and returns an NSDate object set to a given number of seconds from the specified date.
(创建一个距离sincedate有seconds的日期实例)
+ (instancetype)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds
Function:Creates and returns an NSDate object set to a given number of seconds from 00:00:00 UTC on 1 January 2001.
(创建一个距离2001年1月1日00:00:00日期有Seconds的日期实例)
+ (instancetype)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
Function:Creates and returns an NSDate object set to the given number of seconds from 00:00:00 UTC on 1 January 1970.
(创建一个距离1970年1月1日00:00:00有Seconds的日期实例)
+ (NSDate *)distantFuture
Function:Creates and returns an NSDate object representing a date in the distant future.
(返回一个距离现在很久的将来日期类实例)
+ (NSDate *)distantPast
Function:Creates and returns an NSDate object representing a date in the distant past.
(返回一个距离现在很久的过去日期类实例)
+ (NSTimeInterval)timeIntervalSinceReferenceDate
Function:Returns an NSDate object initialized relative to the current date and time by a given number of seconds.
Function:Returns the interval between 00:00:00 UTC on 1 January 2001 and the current date and time.
(返回一个现在距离2001年的时间)
instance of class
- (instancetype)initWithTimeIntervalSinceNow:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to the current date and time by a given number of seconds.
(初始化一个距离现在有Seconds的实例)
- (instancetype)initWithTimeInterval:(NSTimeInterval)seconds
sinceDate:(NSDate *)refDate
Function:Returns an NSDate object initialized relative to another given date by a given number of seconds.
(初始化一个距离日期实例refDateyou有seconds的实例)
- (instancetype)initWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds.
(初始化一个距离2001年有Seconds的实例)
- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.
(初始化一个距离1970年有Seconds的实例)
Comparing Date
- (BOOL)isEqualToDate:(NSDate *)anotherDate
Function:Returns a Boolean value that indicates whether a given object is an NSDate object and exactly equal the receiver.
(返回一个数值:与另一个日期对象相比较是否相等)
- (NSDate *)earlierDate:(NSDate *)anotherDate
Function:Returns the earlier of the receiver and another given date.
(两个日期对象相比 返回更早日期的那个日期对象)
- (NSDate *)laterDate:(NSDate *)anotherDate
Function:Returns the later of the receiver and another given date.
(两个日期对象相比 返回更晚日期的那个对象)
- (NSComparisonResult)compare:(NSDate *)anotherDate
Function:Returns an NSComparisonResult value that indicates the temporal ordering of the receiver and another given date.
(两个对象相等:返回0 目标对象比参数(another)晚:返回1 | 目标对象比参数(another)早:返回-1)
Geting Timer Intervals
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate
Function:Returns the interval between the receiver and another given date.
(返回一个在目标和参数间的时间值(seconds))
Add A Time Interval
- (instancetype)dateByAddingTimeInterval:(NSTimeInterval)seconds
Function:Returns a new NSDate object that is set to a given number of seconds relative to the receiver.
(返回一个日期对象:距离目标有Seconds)
description
- (NSString *)descriptionWithLocale:(id)locale
+ data
return value:A new object set to the current date and time (创建一个新的日期对象实例)
+ (instancetype) dateWithTimeIntervalSinceNow:(NSTimeInTerval)seconds
Function:creates and return an NSDate object set to a give number of seconds from the current date and time
retutn value:An NSDate objecet set to seconds from the current date and time(创建一个现在时间和日期的实例)
+ (instancetype)dateWithTimeInterval:(NSTimeInterval)seconds
sinceDate:(NSDate *)date
Function:Creates and returns an NSDate object set to a given number of seconds from the specified date.
(创建一个距离sincedate有seconds的日期实例)
+ (instancetype)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds
Function:Creates and returns an NSDate object set to a given number of seconds from 00:00:00 UTC on 1 January 2001.
(创建一个距离2001年1月1日00:00:00日期有Seconds的日期实例)
+ (instancetype)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
Function:Creates and returns an NSDate object set to the given number of seconds from 00:00:00 UTC on 1 January 1970.
(创建一个距离1970年1月1日00:00:00有Seconds的日期实例)
+ (NSDate *)distantFuture
Function:Creates and returns an NSDate object representing a date in the distant future.
(返回一个距离现在很久的将来日期类实例)
+ (NSDate *)distantPast
Function:Creates and returns an NSDate object representing a date in the distant past.
(返回一个距离现在很久的过去日期类实例)
+ (NSTimeInterval)timeIntervalSinceReferenceDate
Function:Returns an NSDate object initialized relative to the current date and time by a given number of seconds.
Function:Returns the interval between 00:00:00 UTC on 1 January 2001 and the current date and time.
(返回一个现在距离2001年的时间)
instance of class
- (instancetype)initWithTimeIntervalSinceNow:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to the current date and time by a given number of seconds.
(初始化一个距离现在有Seconds的实例)
- (instancetype)initWithTimeInterval:(NSTimeInterval)seconds
sinceDate:(NSDate *)refDate
Function:Returns an NSDate object initialized relative to another given date by a given number of seconds.
(初始化一个距离日期实例refDateyou有seconds的实例)
- (instancetype)initWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds.
(初始化一个距离2001年有Seconds的实例)
- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)seconds
Function:Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.
(初始化一个距离1970年有Seconds的实例)
Comparing Date
- (BOOL)isEqualToDate:(NSDate *)anotherDate
Function:Returns a Boolean value that indicates whether a given object is an NSDate object and exactly equal the receiver.
(返回一个数值:与另一个日期对象相比较是否相等)
- (NSDate *)earlierDate:(NSDate *)anotherDate
Function:Returns the earlier of the receiver and another given date.
(两个日期对象相比 返回更早日期的那个日期对象)
- (NSDate *)laterDate:(NSDate *)anotherDate
Function:Returns the later of the receiver and another given date.
(两个日期对象相比 返回更晚日期的那个对象)
- (NSComparisonResult)compare:(NSDate *)anotherDate
Function:Returns an NSComparisonResult value that indicates the temporal ordering of the receiver and another given date.
(两个对象相等:返回0 目标对象比参数(another)晚:返回1 | 目标对象比参数(another)早:返回-1)
Geting Timer Intervals
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate
Function:Returns the interval between the receiver and another given date.
(返回一个在目标和参数间的时间值(seconds))
Add A Time Interval
- (instancetype)dateByAddingTimeInterval:(NSTimeInterval)seconds
Function:Returns a new NSDate object that is set to a given number of seconds relative to the receiver.
(返回一个日期对象:距离目标有Seconds)
description
- (NSString *)descriptionWithLocale:(id)locale
0 0
- IOS基本类方法与实例方法之日期总结
- iOS 类方法与实例方法总结
- iOS-OC中的静态方法(类方法)与实例方法
- IOS 类方法与实例方法的区别
- IOS 类方法与实例方法的区别
- iOS 类方法与实例方法的区别
- iOS的类方法和实例方法区别与使用
- 静态方法与实例方法总结:
- iOS类方法、实例方法、构造方法
- IOS 日期类方法集合
- 类方法与实例方法
- 类方法与实例方法
- IOS日期NSDateFormatter方法
- iOS 类方法和实例方法
- iOS中类方法和实例方法
- iOS巅峰之NSURL 基本方法 absoluteString
- iOS开发之OC实例可见度,方法
- JavaSE002_String类总结之常用方法及实例
- 自定义流布局FloatLayout(二)之如何在代码中定义shape资源
- ./configure参数配置
- android实现只切换本应用的语言(不切换android 系统语言)
- Java之Socket与HTTP区别
- 欢迎使用CSDN-markdown编辑器
- IOS基本类方法与实例方法之日期总结
- qemu网络配置
- 【C#基础】重载和重写(覆盖)
- CSS中属性排序
- Spring 源码分析(一) —— 迈向Spring之路
- Oracle断开正在连接的用户
- 使用Jmeter针对ActiveMQ JMS POINT TO POINT压力测试
- 2016年春节前最后一天工作
- 使用jetty热部署运行maven+j2ee项目