Reference documentation and code samples for the Document AI V1beta3 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-09-04 UTC."],[],[],null,["# Document AI V1beta3 API - Class Google::Type::Date (v0.43.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.43.1 (latest)](/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest/Google-Type-Date)\n- [0.43.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.43.0/Google-Type-Date)\n- [0.42.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.42.0/Google-Type-Date)\n- [0.41.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.41.0/Google-Type-Date)\n- [0.40.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.40.0/Google-Type-Date)\n- [0.39.1](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.39.1/Google-Type-Date)\n- [0.38.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.38.0/Google-Type-Date)\n- [0.37.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.37.0/Google-Type-Date)\n- [0.36.1](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.36.1/Google-Type-Date)\n- [0.35.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.35.0/Google-Type-Date)\n- [0.34.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.34.0/Google-Type-Date)\n- [0.33.1](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.33.1/Google-Type-Date)\n- [0.32.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.32.0/Google-Type-Date)\n- [0.31.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.31.0/Google-Type-Date)\n- [0.30.2](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.30.2/Google-Type-Date)\n- [0.29.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.29.0/Google-Type-Date)\n- [0.28.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.28.0/Google-Type-Date)\n- [0.27.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.27.0/Google-Type-Date)\n- [0.26.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.26.0/Google-Type-Date)\n- [0.25.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.25.0/Google-Type-Date)\n- [0.24.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.24.0/Google-Type-Date)\n- [0.23.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.23.0/Google-Type-Date)\n- [0.22.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.22.0/Google-Type-Date)\n- [0.21.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.21.0/Google-Type-Date)\n- [0.20.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.20.0/Google-Type-Date)\n- [0.19.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.19.0/Google-Type-Date)\n- [0.18.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.18.0/Google-Type-Date)\n- [0.17.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.17.0/Google-Type-Date)\n- [0.16.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.16.0/Google-Type-Date)\n- [0.15.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.15.0/Google-Type-Date)\n- [0.14.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.14.0/Google-Type-Date)\n- [0.13.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.13.0/Google-Type-Date)\n- [0.12.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.12.0/Google-Type-Date)\n- [0.11.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.11.0/Google-Type-Date)\n- [0.10.0](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.10.0/Google-Type-Date)\n- [0.9.4](/ruby/docs/reference/google-cloud-document_ai-v1beta3/0.9.4/Google-Type-Date) \nReference documentation and code samples for the Document AI V1beta3 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."]]