Differences From Artifact [fcda070626]:
- File src/OFDate.h — part of check-in [3b97fc3cd9] at 2014-01-04 00:24:08 on branch trunk — Update copyright. (user: js, size: 8951) [annotate] [blame] [check-ins using]
To Artifact [496c98e81f]:
- File
src/OFDate.h
— part of check-in
[dc31ce3d34]
at
2014-01-16 23:09:11
on branch trunk
— Add of_time_interval_t.
This is used instead for time intervals now instead of doubles. (user: js, size: 9059) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
21 22 23 24 25 26 27 | @class OFConstantString; /*! * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { | | | | | 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 | @class OFConstantString; /*! * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { of_time_interval_t _seconds; } /*! * @brief Creates a new OFDate with the current date and time. * * @return A new, autoreleased OFDate with the current date and time */ + (instancetype)date; /*! * @brief Creates a new OFDate with the specified date and time since * 1970-01-01T00:00:00Z. * * @param seconds The seconds since 1970-01-01T00:00:00Z * @return A new, autoreleased OFDate with the specified date and time */ + (instancetype)dateWithTimeIntervalSince1970: (of_time_interval_t)seconds; /*! * @brief Creates a new OFDate with the specified date and time since now. * * @param seconds The seconds since now * @return A new, autoreleased OFDate with the specified date and time */ + (instancetype)dateWithTimeIntervalSinceNow: (of_time_interval_t)seconds; /*! * @brief Creates a new OFDate with the specified string in the specified * format. * * The time zone used is UTC. See @ref dateWithLocalDateString:format: if you * want local time. |
︙ | ︙ | |||
108 109 110 111 112 113 114 | /*! * @brief Initializes an already allocated OFDate with the specified date and * time since 1970-01-01T00:00:00Z. * * @param seconds The seconds since 1970-01-01T00:00:00Z * @return An initialized OFDate with the specified date and time */ | | | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | /*! * @brief Initializes an already allocated OFDate with the specified date and * time since 1970-01-01T00:00:00Z. * * @param seconds The seconds since 1970-01-01T00:00:00Z * @return An initialized OFDate with the specified date and time */ - initWithTimeIntervalSince1970: (of_time_interval_t)seconds; /*! * @brief Initializes an already allocated OFDate with the specified date and * time since now. * * @param seconds The seconds since now * @return An initialized OFDate with the specified date and time */ - initWithTimeIntervalSinceNow: (of_time_interval_t)seconds; /*! * @brief Initializes an already allocated OFDate with the specified string in * the specified format. * * The time zone used is UTC. If a time zone is specified anyway, an * OFInvalidFormatException is thrown. See @ref initWithLocalDateString:format: |
︙ | ︙ | |||
307 308 309 310 311 312 313 | - (OFDate*)laterDate: (OFDate*)otherDate; /*! * @brief Returns the seconds since 1970-01-01T00:00:00Z. * * @return The seconds since 1970-01-01T00:00:00Z */ | | | | | | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | - (OFDate*)laterDate: (OFDate*)otherDate; /*! * @brief Returns the seconds since 1970-01-01T00:00:00Z. * * @return The seconds since 1970-01-01T00:00:00Z */ - (of_time_interval_t)timeIntervalSince1970; /*! * @brief Returns the seconds the receiver is after the date. * * @param otherDate Date date to generate the difference with receiver * @return The seconds the receiver is after the date. */ - (of_time_interval_t)timeIntervalSinceDate: (OFDate*)otherDate; /*! * @brief Returns the seconds the receiver is in the future. * * @return The seconds the receiver is in the future */ - (of_time_interval_t)timeIntervalSinceNow; /*! * @brief Creates a new date with the specified time interval added. * * @param seconds The seconds after the date * @return A new, autoreleased OFDate */ - (OFDate*)dateByAddingTimeInterval: (of_time_interval_t)seconds; @end |