If you run the code below, you'll see that the task is to take one kind of date expression and convert it to another. Every time I find myself writing any kind of code of this nature I have to ask "there has to be a simpler way!". If there is I've failed so far to find it. Any hints?
Code:
Option Compare Database
Option Explicit
Dim Temp() As String
Dim strTime As String
Dim strDay As String
Dim strdate As String
Private Sub TestRun()
MsgBox ReFmt("Tue, 02 Jul 2019 02:18:46 +0000")
End Sub
Private Function ReFmt(TWCreDate As String) As String
Temp = Split(TestDate, " ")
strTime = Temp(4) & "Z"
Temp = Split(TestDate, ",")
strDay = Left(Temp(1), 2)
Temp = Split(Temp(1), ":")
strdate = Left(Temp(0), Len(Temp(0)) - 3)
ReFmt = Format(strdate, "yyyy-mm-ddT") & strTime
End Function