Class DiscoveryFormat
Inheritance
DiscoveryFormat
Assembly: Google.Apis.Core.dll
public static class DiscoveryFormat
Methods
Formats a DateTime value appropriately for a Discovery "date-time" value.
This does not automatically convert the given value to UTC; some services require values
to be presented in UTC, in which case user code should ensure that only UTC values are
specified.
Declaration
public static string FormatDateTimeOffsetToDateTime(DateTimeOffset? value)
Parameters
Returns
Formats a DateTime value appropriately for a Discovery "google-datetime" value.
This automatically converts the given value to UTC before formatting.
Declaration
public static string FormatDateTimeOffsetToGoogleDateTime(DateTimeOffset? value)
Parameters
Returns
Parses a Discovery "date-time" format value to DateTimeOffset.
The value must start in the format "yyyy-MM-ddTHH:mm:ss", with optional milliseconds,
microseconds and nanoseconds. A UTC offset may be provided with up to second precision
(e.g. +01, -02:30, +03:45:12), or "Z" for UTC. If nanosecond precision is provided,
the value is truncated to .NET "tick" precision (100ns). If the UTC offset has a non-zero
seconds component, a value is returned which preserves the instant in time, but truncates
the UTC offset to the minute.
Declaration
public static DateTimeOffset? ParseDateTimeToDateTimeOffset(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns
Parses a Discovery "google-datetime" format value to DateTimeOffset.
The value must start in the format "yyyy-MM-ddTHH:mm:ss", with optional milliseconds,
microseconds and nanoseconds, and a trailing 'Z' to indicate UTC.
Declaration
public static DateTimeOffset? ParseGoogleDateTimeToDateTimeOffset(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns