[[["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."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eDateExtensions\u003c/code\u003e class, which offers extension methods for working with the \u003ccode\u003eDate\u003c/code\u003e type within the \u003ccode\u003eGoogle.Type\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDateExtensions\u003c/code\u003e class is part of the \u003ccode\u003eGoogle.Api.CommonProtos.dll\u003c/code\u003e assembly and inherits from the base \u003ccode\u003eobject\u003c/code\u003e class, inheriting its members as well.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes methods for converting \u003ccode\u003eDateTime\u003c/code\u003e and \u003ccode\u003eDateTimeOffset\u003c/code\u003e instances to the \u003ccode\u003eDate\u003c/code\u003e type, named \u003ccode\u003eToDate(DateTime)\u003c/code\u003e and \u003ccode\u003eToDate(DateTimeOffset)\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the documented files is 2.15.0, with previous versions 2.10.0 and 2.2.0 also available.\u003c/p\u003e\n"]]],[],null,["# Class DateExtensions (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.DateExtensions)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Type.DateExtensions)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Type.DateExtensions)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Type.DateExtensions) \n\n public static class DateExtensions\n\nExtension methods built for [Date](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e DateExtensions \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Type](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nMethods\n-------\n\n### ToDate(DateTime)\n\n public static Date ToDate(this DateTime dateTime)\n\nConverts the [Date](https://learn.microsoft.com/dotnet/api/system.datetime.date) part of [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) to [Date](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date).\n\n### ToDate(DateTimeOffset)\n\n public static Date ToDate(this DateTimeOffset dateTimeOffset)\n\nConverts the [Date](https://learn.microsoft.com/dotnet/api/system.datetimeoffset.date) part of [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) to [Date](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date)."]]