Reference documentation and code samples for the Cloud Channel V1 API class Google::Type::Date.
Represents a whole or partial calendar date, such as a birthday. The time of
day and time zone are either specified elsewhere or are insignificant. The
date is relative to the Gregorian Calendar. This can represent one of the
following:
A full date, with non-zero year, month, and day values
A month and day value, with a zero year, such as an anniversary
A year on its own, with zero month and day values
A year and month value, with a zero day, such as a credit card expiration
date
Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
google.protobuf.Timestamp.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#day
defday()->::Integer
Returns
(::Integer) — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
to specify a year by itself or a year and month where the day isn't
significant.
#day=
defday=(value)->::Integer
Parameter
value (::Integer) — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
to specify a year by itself or a year and month where the day isn't
significant.
Returns
(::Integer) — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
to specify a year by itself or a year and month where the day isn't
significant.
#month
defmonth()->::Integer
Returns
(::Integer) — Month of a year. Must be from 1 to 12, or 0 to specify a year without a
month and day.
#month=
defmonth=(value)->::Integer
Parameter
value (::Integer) — Month of a year. Must be from 1 to 12, or 0 to specify a year without a
month and day.
Returns
(::Integer) — Month of a year. Must be from 1 to 12, or 0 to specify a year without a
month and day.
#year
defyear()->::Integer
Returns
(::Integer) — Year of the date. Must be from 1 to 9999, or 0 to specify a date without
a year.
#year=
defyear=(value)->::Integer
Parameter
value (::Integer) — Year of the date. Must be from 1 to 9999, or 0 to specify a date without
a year.
Returns
(::Integer) — Year of the date. Must be from 1 to 9999, or 0 to specify a date without
a year.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Channel V1 API - Class Google::Type::Date (v2.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.1 (latest)](/ruby/docs/reference/google-cloud-channel-v1/latest/Google-Type-Date)\n- [2.2.0](/ruby/docs/reference/google-cloud-channel-v1/2.2.0/Google-Type-Date)\n- [2.1.0](/ruby/docs/reference/google-cloud-channel-v1/2.1.0/Google-Type-Date)\n- [2.0.1](/ruby/docs/reference/google-cloud-channel-v1/2.0.1/Google-Type-Date)\n- [1.3.0](/ruby/docs/reference/google-cloud-channel-v1/1.3.0/Google-Type-Date)\n- [1.2.0](/ruby/docs/reference/google-cloud-channel-v1/1.2.0/Google-Type-Date)\n- [1.1.0](/ruby/docs/reference/google-cloud-channel-v1/1.1.0/Google-Type-Date)\n- [1.0.1](/ruby/docs/reference/google-cloud-channel-v1/1.0.1/Google-Type-Date)\n- [0.24.0](/ruby/docs/reference/google-cloud-channel-v1/0.24.0/Google-Type-Date)\n- [0.23.2](/ruby/docs/reference/google-cloud-channel-v1/0.23.2/Google-Type-Date)\n- [0.22.1](/ruby/docs/reference/google-cloud-channel-v1/0.22.1/Google-Type-Date)\n- [0.21.0](/ruby/docs/reference/google-cloud-channel-v1/0.21.0/Google-Type-Date)\n- [0.20.0](/ruby/docs/reference/google-cloud-channel-v1/0.20.0/Google-Type-Date)\n- [0.19.0](/ruby/docs/reference/google-cloud-channel-v1/0.19.0/Google-Type-Date)\n- [0.18.0](/ruby/docs/reference/google-cloud-channel-v1/0.18.0/Google-Type-Date)\n- [0.17.0](/ruby/docs/reference/google-cloud-channel-v1/0.17.0/Google-Type-Date)\n- [0.16.0](/ruby/docs/reference/google-cloud-channel-v1/0.16.0/Google-Type-Date)\n- [0.15.0](/ruby/docs/reference/google-cloud-channel-v1/0.15.0/Google-Type-Date)\n- [0.14.0](/ruby/docs/reference/google-cloud-channel-v1/0.14.0/Google-Type-Date)\n- [0.13.0](/ruby/docs/reference/google-cloud-channel-v1/0.13.0/Google-Type-Date)\n- [0.12.0](/ruby/docs/reference/google-cloud-channel-v1/0.12.0/Google-Type-Date)\n- [0.11.0](/ruby/docs/reference/google-cloud-channel-v1/0.11.0/Google-Type-Date)\n- [0.10.0](/ruby/docs/reference/google-cloud-channel-v1/0.10.0/Google-Type-Date)\n- [0.9.5](/ruby/docs/reference/google-cloud-channel-v1/0.9.5/Google-Type-Date) \nReference documentation and code samples for the Cloud Channel V1 API class Google::Type::Date.\n\nRepresents a whole or partial calendar date, such as a birthday. The time of\nday and time zone are either specified elsewhere or are insignificant. The\ndate is relative to the Gregorian Calendar. This can represent one of the\nfollowing:\n\n\n- A full date, with non-zero year, month, and day values\n- A month and day value, with a zero year, such as an anniversary\n- A year on its own, with zero month and day values\n- A year and month value, with a zero day, such as a credit card expiration date\n\n\u003cbr /\u003e\n\nRelated types are \\[google.type.TimeOfDay\\]\\[google.type.TimeOfDay\\] and\n`google.protobuf.Timestamp`. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #day\n\n def day() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.\n\n### #day=\n\n def day=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. \n**Returns**\n\n- (::Integer) --- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.\n\n### #month\n\n def month() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.\n\n### #month=\n\n def month=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. \n**Returns**\n\n- (::Integer) --- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.\n\n### #year\n\n def year() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.\n\n### #year=\n\n def year=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. \n**Returns**\n\n- (::Integer) --- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year."]]