2.17.0 (latest) 2.15.0 2.10.0 2.2.0

    public static class DateExtensions

Extension methods built for [Date](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date.md.txt).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> DateExtensions

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Type](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.md.txt)

## Assembly

Google.Api.CommonProtos.dll

## Methods

### ToDate(DateTime)

    public static Date ToDate(this DateTime dateTime)

Converts the [Date](https://learn.microsoft.com/dotnet/api/system.datetime.date) part of [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) to [Date](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date.md.txt).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dateTime` | `DateTime` The [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) instance being converted. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Date` | The [Date](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date.md.txt). |

### ToDate(DateTimeOffset)

    public static Date ToDate(this DateTimeOffset dateTimeOffset)

Converts the [Date](https://learn.microsoft.com/dotnet/api/system.datetimeoffset.date) part of [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) to [Date](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date.md.txt).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dateTimeOffset` | `DateTimeOffset` The [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) instance being converted. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Date` | The converted [Date](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Date.md.txt). |