Skip to content
/ VBA-UTC Public
forked from VBA-tools/VBA-UTC

UTC and ISO 8601 date conversion and parsing for VBA

License

Notifications You must be signed in to change notification settings

hecon5/VBA-UTC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VBA-UTC

UTC and ISO 8601 date conversion and parsing for VBA (Windows and Mac Excel, Access, and other Office applications).

Tested in Excel 2016 for Windows and Mac, but should apply to Windows Excel 2007+.

Donate

Example

' Timezone: EST (UTC-5:00), DST: True (+1:00) -> UTC-4:00
Dim LocalDate As Date
Dim UtcDate As Date
Dim Iso As String

LocalDate = DateValue("Jan. 2, 2003") + TimeValue("4:05:06 PM")
UtcDate = UtcConverter.ConvertToUtc(LocalDate)

Debug.Print VBA.Format$(UtcDate, "yyyy-mm-ddTHH:mm:ss.000Z")
' -> "2003-01-02T20:05:06.000Z"

Iso = UtcConverter.ConvertToIso(LocalDate)
Debug.Print Iso
' -> "2003-01-02T20:05:06.000Z"

LocalDate = UtcConverter.ParseUtc(UtcDate)
LocalDate = UtcConverter.ParseIso(Iso)

Debug.Print VBA.Format$(LocalDate, "m/d/yyyy h:mm:ss AM/PM")
' -> "1/2/2003 4:05:06 PM"

About

UTC and ISO 8601 date conversion and parsing for VBA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • VBA 100.0%