1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: google/protobuf/timestamp.proto 3 4 // This CPP symbol can be defined to use imports that match up to the framework 5 // imports needed when using CocoaPods. 6 #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) 7 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 8 #endif 9 10 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 11 #import <Protobuf/GPBProtocolBuffers.h> 12 #else 13 #import "GPBProtocolBuffers.h" 14 #endif 15 16 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 17 #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. 18 #endif 19 20 // @@protoc_insertion_point(imports) 21 22 #pragma clang diagnostic push 23 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 24 25 CF_EXTERN_C_BEGIN 26 27 NS_ASSUME_NONNULL_BEGIN 28 29 #pragma mark - GPBTimestampRoot 30 31 /// Exposes the extension registry for this file. 32 /// 33 /// The base class provides: 34 /// @code 35 /// + (GPBExtensionRegistry *)extensionRegistry; 36 /// @endcode 37 /// which is a @c GPBExtensionRegistry that includes all the extensions defined by 38 /// this file and all files that it depends on. 39 @interface GPBTimestampRoot : GPBRootObject 40 @end 41 42 #pragma mark - GPBTimestamp 43 44 typedef GPB_ENUM(GPBTimestamp_FieldNumber) { 45 GPBTimestamp_FieldNumber_Seconds = 1, 46 GPBTimestamp_FieldNumber_Nanos = 2, 47 }; 48 49 /// A Timestamp represents a point in time independent of any time zone 50 /// or calendar, represented as seconds and fractions of seconds at 51 /// nanosecond resolution in UTC Epoch time. It is encoded using the 52 /// Proleptic Gregorian Calendar which extends the Gregorian calendar 53 /// backwards to year one. It is encoded assuming all minutes are 60 54 /// seconds long, i.e. leap seconds are "smeared" so that no leap second 55 /// table is needed for interpretation. Range is from 56 /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. 57 /// By restricting to that range, we ensure that we can convert to 58 /// and from RFC 3339 date strings. 59 /// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). 60 /// 61 /// Example 1: Compute Timestamp from POSIX `time()`. 62 /// 63 /// Timestamp timestamp; 64 /// timestamp.set_seconds(time(NULL)); 65 /// timestamp.set_nanos(0); 66 /// 67 /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. 68 /// 69 /// struct timeval tv; 70 /// gettimeofday(&tv, NULL); 71 /// 72 /// Timestamp timestamp; 73 /// timestamp.set_seconds(tv.tv_sec); 74 /// timestamp.set_nanos(tv.tv_usec * 1000); 75 /// 76 /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. 77 /// 78 /// FILETIME ft; 79 /// GetSystemTimeAsFileTime(&ft); 80 /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; 81 /// 82 /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z 83 /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. 84 /// Timestamp timestamp; 85 /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); 86 /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); 87 /// 88 /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. 89 /// 90 /// long millis = System.currentTimeMillis(); 91 /// 92 /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) 93 /// .setNanos((int) ((millis % 1000) * 1000000)).build(); 94 /// 95 /// 96 /// Example 5: Compute Timestamp from current time in Python. 97 /// 98 /// now = time.time() 99 /// seconds = int(now) 100 /// nanos = int((now - seconds) * 10**9) 101 /// timestamp = Timestamp(seconds=seconds, nanos=nanos) 102 @interface GPBTimestamp : GPBMessage 103 104 /// Represents seconds of UTC time since Unix epoch 105 /// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to 106 /// 9999-12-31T23:59:59Z inclusive. 107 @property(nonatomic, readwrite) int64_t seconds; 108 109 /// Non-negative fractions of a second at nanosecond resolution. Negative 110 /// second values with fractions must still have non-negative nanos values 111 /// that count forward in time. Must be from 0 to 999,999,999 112 /// inclusive. 113 @property(nonatomic, readwrite) int32_t nanos; 114 115 @end 116 117 NS_ASSUME_NONNULL_END 118 119 CF_EXTERN_C_END 120 121 #pragma clang diagnostic pop 122 123 // @@protoc_insertion_point(global_scope) 124