;; 
;;=====================================================================================----- 
;; 
;;FUNCTION       DateTimeUTC() 
;; 
;;ACTION         Returns the local time represented as UTC 
;; 
;;AUTHOR         Glenn Barnas 
;; 
;;VERSION        1.1 - 2020/04/23 
;; 
;;HISTORY        1.0 - 2018/06/01 - Initial Release 
;;               1.1 - 2020/04/23 - simplify logic 
;; 
;;SYNTAX         DateTimeUTC() 
;; 
;;PARAMETERS     none 
;; 
;;REMARKS        Returns the UTC date/time based on the local time 
;; 
;;RETURNS        String - DATE TIME 
;; 
;;DEPENDENCIES   TimeConvert() 
;; 
;;TESTED WITH    W2K8, W2K12, W2K16 
;; 
;;EXAMPLES       $UTC = DateTimeUTC() 
; 
Function DateTimeUTC()
 
  Dim $_Offset							; Offset to calculate 
 
  ; Get the offset in minutes and convert to the directional offset in seconds 
  $_Offset = 60 * ReadValue('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation', 'ActiveTimeBias')
 
  ; Perform the cTime calculation and return UTC for the current date/time 
  $DateTimeUTC = TimeConvert(TimeConvert(@DATE + ' ' + @TIME) + $_Offset)
 
  Exit 0
 
EndFunction