# Google BigQuery v2 API - Class BigQueryDateTimeExtensions (3.12.0)

3.12.0 (latest) 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.4.0 2.3.0 2.2.0

    public static class BigQueryDateTimeExtensions

Reference documentation and code samples for the Google BigQuery v2 API class BigQueryDateTimeExtensions.

Extension methods for `System.DateTime` and `System.DateTimeOffset` for use with BigQuery.

## Inheritance

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

## Inherited Members

[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.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BigQuery.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2)

## Assembly

Google.Cloud.BigQuery.V2.dll

## Methods

### AsBigQueryDate(DateTime)

    public static string AsBigQueryDate(this DateTime value)

Returns the given date and time formatted as BigQuery expects date values to be formatted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.datetime` The date/time value to extract the date from. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The date in yyyy-MM-dd format. |

### AsBigQueryDate(DateTimeOffset)

    public static string AsBigQueryDate(this DateTimeOffset value)

Returns the given date and time formatted as BigQuery expects date values to be formatted.
The "local" value of the `DateTimeOffset` is used; it is not converted to UTC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.datetimeoffset` The date/time offset value to extract the date from. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The date in yyyy-MM-dd format. |