CONVERTDATETIME

Description

Converts the specified DateTime from one time zone to another, using the specified FromUTCOffset and ToUTCOffset. This function accounts for Daylight Savings using the specified locations.

Syntax

CONVERTDATETIME( DateTime, "FromUTCOffset", "US" | "EU" | "AU" | " ", "ToUTCOffset", "US" | "EU" | "AU" | "" )

Parameter Description
DateTime The value to convert.
FromUTCOffset UTC offset for the time zone that the DateTime is currently in.
ToUTCOffset UTC offset for the time zone to convert the DateTime to.
"US" | "EU" | "AU" | " "

Indicates a country or region to use to adjust for Daylight Savings Time (DST). The following values are supported: 

  • US — US or equivalent
  • EU — European Union, UK, or equivalent
  • AU — Australia
  • Blank — Location does not observe DST (ex: Arizona), or UTC

Remarks

FromUTCOffset and ToUTCOffset are the standard GMT offsets that specify a given time zone. For example, Eastern Time is -5, Pacific is -8, etc.

You can determine the offset for your location (or another location) from the Windows Date and Time dialog box, which you can open from the clock in your Windows taskbar. Find and open the Time Zone drop-down box (the location depends on your version of Windows). The offset is shown before the name of each location.

Fractional offsets are allowed; for example to handle Newfoundland, which is -3:30, use -3.5.

Examples

Convert Phoenix time (no DST) to UTC:

CONVERTDATETIME( DateTime, -7, "", 0, "" ) 

Convert Eastern time to London:

CONVERTDATETIME( DateTime, -5, "US", 0, "EU" )

See also

LOCAL2UTC

UTC2LOCAL