public sealed class Date : IMessage<Date>, IEquatable<Date>, IDeepCloneable<Date>, IBufferMessage, IMessage
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eDate\u003c/code\u003e class in the \u003ccode\u003eGoogle.Type\u003c/code\u003e namespace, representing a calendar date with year, month, and day components, which can represent a full date, a month and day, a year alone, or a year and month.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDate\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties such as \u003ccode\u003eYear\u003c/code\u003e, \u003ccode\u003eMonth\u003c/code\u003e, and \u003ccode\u003eDay\u003c/code\u003e, which allow for specifying different levels of detail in a date, along with constant fields like \u003ccode\u003eYearFieldNumber\u003c/code\u003e, \u003ccode\u003eMonthFieldNumber\u003c/code\u003e, and \u003ccode\u003eDayFieldNumber\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class has constructors to create new \u003ccode\u003eDate\u003c/code\u003e objects and methods for cloning, comparing, converting to and from DateTime/DateTimeOffset, and handling input/output operations through \u003ccode\u003eCodedInputStream\u003c/code\u003e and \u003ccode\u003eCodedOutputStream\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe static methods \u003ccode\u003eFromDateTime\u003c/code\u003e and \u003ccode\u003eFromDateTimeOffset\u003c/code\u003e allow you to easily create a date from \u003ccode\u003eDateTime\u003c/code\u003e and \u003ccode\u003eDateTimeOffset\u003c/code\u003e objects, whereas \u003ccode\u003eToDateTime\u003c/code\u003e and \u003ccode\u003eToDateTimeOffset\u003c/code\u003e do the reverse.\u003c/p\u003e\n"]]],[],null,[]]