' This dictation command converts the current computer local time to the ' Military Date Time Group ZULU Time ' It automatically retrieves Time Zone information from your computer Time Zone setting. ' ' Military Date Time Group is traditionally formated as: ' ' DDHHMMZMONYY (dd hh mm (Z) MON yy) ' ' DAY - 24 HOUR TIME - MILITARY TIME CODE (ZONE) LETTER - MONTH - YEAR (without '-',spaces, and parentheses) ' ' 12:02 pm On January 20th 2017 In Washington DC (Eastern time zone) ' ' 201202RJAN17 ' ' DD-Day of the Month (e.g. January 20th = 20) ' HHMM- Time In 24 hr Format +military Time zone (e.g. 12:02pm = 1202). ' "R" = Military Time Zone identifier (see list below) ' MON- Uppercase 3 digit Month code, (e.g. January = JAN) ' YY- 2 Digit Year, (e.g. 2017 = 17) ' ' The Military Date Time Group (DTG) never observes Daylight Savings Time ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Option Explicit Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Type TIME_ZONE_INFORMATION Bias As Long StandardName(0 To 31) As Integer StandardDate As SYSTEMTIME StandardBias As Long DaylightName(0 To 31) As Integer DaylightDate As SYSTEMTIME DaylightBias As Long End Type Private Enum TIME_ZONE TIME_ZONE_ID_INVALID = 0 ' Cannot determine DST TIME_ZONE_STANDARD = 1 ' Standard Time, not Daylight TIME_ZONE_DAYLIGHT = 2 ' Daylight Time, not Standard End Enum Private Declare Function GetTimeZoneInformation Lib "kernel32" _ (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long Private Declare Sub GetSystemTime Lib "kernel32" _ (lpSystemTime As SYSTEMTIME) Dim TZI As TIME_ZONE_INFORMATION Dim DST As TIME_ZONE Dim DTGUTC As Date Dim UTCTime,UTCMonth,UTCYear As String ' Convert Computer Local Time To UTC Function ComputerTimeToUTC As Date ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ComputerTimeToUTC ' This function returns the UTC based on Computer Time ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim DB As Date Dim TZI As TIME_ZONE_INFORMATION Dim DST As TIME_ZONE Dim UTC As Date DST = GetTimeZoneInformation(TZI) ' DST=1 ' Test Standard Time Fudge Factor If DST = TIME_ZONE_DAYLIGHT Then DB = TimeSerial(1, 0, 0) Else DB = 0 If TZI.Bias - DB < 0 Then UTC = Now - TimeSerial(-TZI.Bias/60,0,0) - DB Else UTC = Now + TimeSerial(TZI.Bias/60,0,0) - DB End If ComputerTimeToUTC = UTC End Function Sub Main DST = GetTimeZoneInformation(TZI) DTGUTC = ComputerTimeToUTC ' DTGUTC = TimeUTC UTCMonth = Format(DTGUTC,"mmm") UTCMonth = UCase$(UTCMonth) UTCYear = Format(DTGUTC,"yy") UTCTime = Format(DTGUTC,"ddhhmmZ") ' <---TIME CODE LETTER SendKeys UTCTime + UTCMonth + UTCYear + " " End Sub ' ' Military Time Code (Time Zone) Letter Reference: ' UTC+1: A (France) ' UTC+2: B (Athens, Greece) ' UTC+3: C (Arab Standard Time, Iraq, Bahrain, Kuwait, Saudi Arabia, Yemen, Qatar) ' UTC+4: D (Used for Moscow, Russia and Afghanistan, however Afghanistan is technically +4:30 from UTC) ' UTC+5: E (Pakistan, Kazakhstan, Tajikistan, Uzbekistan and Turkmenistan) ' UTC+6: F (Bangladesh) ' UTC+7: G (Thailand) ' UTC+8: H (Beijing, China) ' UTC+9: I (Tokyo, Australia) ' UTC+10: K (Brisbane, Australia) ' UTC+11: L (Sydney, Australia) ' UTC+12: M (Wellington, New Zealand) ' UTC-12: Y- (e.g. Fiji) ' UTC-11: X (American Samoa) ' UTC-10: W (Honolulu, HI) ' UTC-9: V (Juneau, AK) ' UTC-8: U (PST, Los Angeles, CA) ' UTC-7: T (MST, Denver, CO) ' UTC-6: S (CST, Dallas, TX) ' UTC-5: R (EST, New York, NY) ' UTC-4: Q (Halifax, Nova Scotia ' UTC-3: P (Buenos Aires, Argentina) ' UTC-2: O (Godthab, Greenland) ' UTC-1: N (Azores) ' UTC+-0: Z (Zulu time)