public final class DateTime extends com.google.protobuf.GeneratedMessageV3 implements DateTimeOrBuilder
Represents civil time (or occasionally physical time).
This type can represent a civil time in one of a few possible ways:
* When utc_offset is set and time_zone is unset: a civil time on a calendar
day with a particular offset from UTC.
* When time_zone is set and utc_offset is unset: a civil time on a calendar
day in a particular time zone.
* When neither time_zone nor utc_offset is set: a civil time on a calendar
day in local time.
The date is relative to the Proleptic Gregorian Calendar.
If year is 0, the DateTime is considered not to have a specific year. month
and day must have valid, non-zero values.
This type may also be used to represent a physical time if all the date and
time fields are set and either case of the `time_offset` oneof is set.
Consider using `Timestamp` message for physical time instead. If your use
case also would like to store the user's timezone, that can be done in
another field.
This type is more flexible than some applications may want. Make sure to
document and validate your application's limitations.
Protobuf type google.type.DateTime| Modifier and Type | Class and Description |
|---|---|
static class |
DateTime.Builder
Represents civil time (or occasionally physical time).
|
static class |
DateTime.TimeOffsetCase |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
DAY_FIELD_NUMBER |
static int |
HOURS_FIELD_NUMBER |
static int |
MINUTES_FIELD_NUMBER |
static int |
MONTH_FIELD_NUMBER |
static int |
NANOS_FIELD_NUMBER |
static int |
SECONDS_FIELD_NUMBER |
static int |
TIME_ZONE_FIELD_NUMBER |
static int |
UTC_OFFSET_FIELD_NUMBER |
static int |
YEAR_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getDay()
Required.
|
static DateTime |
getDefaultInstance() |
DateTime |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
int |
getHours()
Required.
|
int |
getMinutes()
Required.
|
int |
getMonth()
Required.
|
int |
getNanos()
Required.
|
com.google.protobuf.Parser<DateTime> |
getParserForType() |
int |
getSeconds()
Required.
|
int |
getSerializedSize() |
DateTime.TimeOffsetCase |
getTimeOffsetCase() |
TimeZone |
getTimeZone()
Time zone.
|
TimeZoneOrBuilder |
getTimeZoneOrBuilder()
Time zone.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
com.google.protobuf.Duration |
getUtcOffset()
UTC offset.
|
com.google.protobuf.DurationOrBuilder |
getUtcOffsetOrBuilder()
UTC offset.
|
int |
getYear()
Optional.
|
int |
hashCode() |
boolean |
hasTimeZone()
Time zone.
|
boolean |
hasUtcOffset()
UTC offset.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static DateTime.Builder |
newBuilder() |
static DateTime.Builder |
newBuilder(DateTime prototype) |
DateTime.Builder |
newBuilderForType() |
protected DateTime.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static DateTime |
parseDelimitedFrom(InputStream input) |
static DateTime |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DateTime |
parseFrom(byte[] data) |
static DateTime |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DateTime |
parseFrom(ByteBuffer data) |
static DateTime |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DateTime |
parseFrom(com.google.protobuf.ByteString data) |
static DateTime |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DateTime |
parseFrom(com.google.protobuf.CodedInputStream input) |
static DateTime |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DateTime |
parseFrom(InputStream input) |
static DateTime |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<DateTime> |
parser() |
DateTime.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int YEAR_FIELD_NUMBER
public static final int MONTH_FIELD_NUMBER
public static final int DAY_FIELD_NUMBER
public static final int HOURS_FIELD_NUMBER
public static final int MINUTES_FIELD_NUMBER
public static final int SECONDS_FIELD_NUMBER
public static final int NANOS_FIELD_NUMBER
public static final int UTC_OFFSET_FIELD_NUMBER
public static final int TIME_ZONE_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public DateTime.TimeOffsetCase getTimeOffsetCase()
getTimeOffsetCase in interface DateTimeOrBuilderpublic int getYear()
Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a datetime without a year.
int32 year = 1;getYear in interface DateTimeOrBuilderpublic int getMonth()
Required. Month of year. Must be from 1 to 12.
int32 month = 2;getMonth in interface DateTimeOrBuilderpublic int getDay()
Required. Day of month. Must be from 1 to 31 and valid for the year and month.
int32 day = 3;getDay in interface DateTimeOrBuilderpublic int getHours()
Required. Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.
int32 hours = 4;getHours in interface DateTimeOrBuilderpublic int getMinutes()
Required. Minutes of hour of day. Must be from 0 to 59.
int32 minutes = 5;getMinutes in interface DateTimeOrBuilderpublic int getSeconds()
Required. Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.
int32 seconds = 6;getSeconds in interface DateTimeOrBuilderpublic int getNanos()
Required. Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
int32 nanos = 7;getNanos in interface DateTimeOrBuilderpublic boolean hasUtcOffset()
UTC offset. Must be whole seconds, between -18 hours and +18 hours.
For example, a UTC offset of -4:00 would be represented as
{ seconds: -14400 }.
.google.protobuf.Duration utc_offset = 8;hasUtcOffset in interface DateTimeOrBuilderpublic com.google.protobuf.Duration getUtcOffset()
UTC offset. Must be whole seconds, between -18 hours and +18 hours.
For example, a UTC offset of -4:00 would be represented as
{ seconds: -14400 }.
.google.protobuf.Duration utc_offset = 8;getUtcOffset in interface DateTimeOrBuilderpublic com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder()
UTC offset. Must be whole seconds, between -18 hours and +18 hours.
For example, a UTC offset of -4:00 would be represented as
{ seconds: -14400 }.
.google.protobuf.Duration utc_offset = 8;getUtcOffsetOrBuilder in interface DateTimeOrBuilderpublic boolean hasTimeZone()
Time zone.
.google.type.TimeZone time_zone = 9;hasTimeZone in interface DateTimeOrBuilderpublic TimeZone getTimeZone()
Time zone.
.google.type.TimeZone time_zone = 9;getTimeZone in interface DateTimeOrBuilderpublic TimeZoneOrBuilder getTimeZoneOrBuilder()
Time zone.
.google.type.TimeZone time_zone = 9;getTimeZoneOrBuilder in interface DateTimeOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static DateTime parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DateTime parseFrom(InputStream input) throws IOException
IOExceptionpublic static DateTime parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DateTime parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static DateTime parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DateTime parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static DateTime parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic DateTime.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static DateTime.Builder newBuilder()
public static DateTime.Builder newBuilder(DateTime prototype)
public DateTime.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected DateTime.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static DateTime getDefaultInstance()
public static com.google.protobuf.Parser<DateTime> parser()
public com.google.protobuf.Parser<DateTime> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public DateTime getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2021 Google LLC. All rights reserved.