Current Time To Utc

Current

UTC (Time Zone) Sunday, May 2, 2021 at 9:55:49 am UTC UTC Amsterdam (Netherlands) Sunday, May 2, 2021 at 11:55:49 am CEST UTC+2 hours How to use the Time Zone Converter. Glossary UTC Coordinated Universal Time - the international basis for other time zones.

-->
  1. This site provides the current time in milliseconds elapsed since the UNIX epoch (Jan 1, 1970) as well as in other common formats including local / UTC time comparisons. You can also convert milliseconds to date & time and the other way around.
  2. Convert Time From (UTC/GMT) to any time zone. Need to compare more than just two places at once? Try our World Meeting Planner and get a color-coded chart comparing the time of day in (UTC/GMT) with all of the other international locations where others will be participating.

Definition

Converts a date and time to Coordinated Universal Time (UTC).

Overloads

ConvertTimeToUtc(DateTime, TimeZoneInfo)

Converts the time in a specified time zone to Coordinated Universal Time (UTC).

ConvertTimeToUtc(DateTime)

Converts the specified date and time to Coordinated Universal Time (UTC).

Time

Converts the time in a specified time zone to Coordinated Universal Time (UTC).

Parameters

sourceTimeZone
TimeZoneInfo

The time zone of dateTime.

Returns

DateTime

The Coordinated Universal Time (UTC) that corresponds to the dateTime parameter. The DateTime object's Kind property is always set to Utc.

Exceptions

dateTime.Kind is Utc and sourceTimeZone does not equal Utc.

Current Time To Utc

-or-

dateTime.Kind is Local and sourceTimeZone does not equal Local.

-or-

sourceTimeZone.IsInvalidDateTime(dateTime) returns true.

sourceTimeZone is null.

Examples

The following example retrieves the current date from the local system and converts it to Coordinated Universal Time (UTC), then converts it to Tokyo Standard Time, and finally converts from Tokyo Standard Time back to UTC. Note that the two UTC times are identical.

Remarks

If the Kind property of the dateTime parameter equals DateTimeKind.Utc and the sourceTimeZone parameter equals TimeZoneInfo.Utc, this method returns dateTime without performing any conversion.

If dateTime corresponds to an ambiguous time, this method assumes that it is the standard time of the source time zone. If dateTime corresponds to an invalid time, this method throws an ArgumentException.

If the Coordinated Universal Time (UTC) equivalent of dateTime is earlier than DateTime.MinValue or later that DateTime.MaxValue, this method returns MinValue or MaxValue, respectively.

See also

Applies to

Converts the specified date and time to Coordinated Universal Time (UTC).

Parameters

Current Time To Utc

Time

Returns

DateTime

The Coordinated Universal Time (UTC) that corresponds to the dateTime parameter. The DateTime value's Kind property is always set to Utc.

Exceptions

TimeZoneInfo.Local.IsInvalidDateTime(dateTime) returns true.

Examples

The following example illustrates the conversion of time values whose Kind property is DateTimeKind.Utc, DateTimeKind.Local, and DateTimeKind.Unspecified, respectively. It also illustrates the conversion of ambiguous and invalid times.

Remarks

The exact conversion performed depends on the value of the Kind property of the dateTime parameter, as the following table shows.

True innovations accent chair. Office & Desk Chairs. True Innovations Task Chair. True Innovations Task Chair Metal BasePneumatic Height AdjustmentTilt Lock FeatureAvailable in Black, Blue or White. Buy True Innovations Swivel-Tilt Task Chair, Choose a Color: Task Chairs at SamsClub.com. This True Innovations® mesh back task chair offers exceptional comfort, and maximum support. Featuring a breathable mesh back that doesn’t trap in heat and moisture, increasing airflow and keeping you cool, allowing for a longer lasting more comfortable seating experience. In addition, a pneumatic height adjustable seat, and tilt lock feature provide the perfect ergonomic seating position, along with. The Office Chair also includes a colored LED trim for a cool ambient effect in a darker room. If you are looking for a chair that offers maximized comfort, support and value you will be pleased with the True Innovations Gaming Office Chair. Back type: high back; Material: PU bonded leather Upholstery; Color: Black/White.

DateTime.Kind propertyConversion
DateTimeKind.LocalConverts from local time to Coordinated Universal Time (UTC).
DateTimeKind.UnspecifiedAssumes dateTime is local time and converts from local time to UTC.
DateTimeKind.UtcReturns dateTime unchanged.

If dateTime corresponds to an ambiguous local time, this method assumes that it is standard local time. If dateTime corresponds to an invalid local time, the method throws an ArgumentException.

Note

If the current computer's local time zone includes multiple adjustment rules, this overload of the ConvertTimeToUtc method can return results that differ from the TimeZone.ToUniversalTime and DateTime.ToUniversalTime methods. TimeZone.ToUniversalTime always applies the current adjustment rule to time zone conversion, whether or not dateTime lies within its date range. And when executing on .NET Framework 3.5, DateTime.ToUniversalTime also applies the current adjustment rule to time zone conversion, whether or not dateTime lies within its date range.

If the UTC equivalent of dateTime is earlier than DateTime.MinValue or later that DateTime.MaxValue, this method returns MinValue or MaxValue, respectively.

Current Time To Utc Online

See also