AutoIt Requires Chilkat v11.0.0+
AutoIt
Read the sender’s Date in UTC and local time
See more Email Object Examples
Parse the Date header from an EML file, then print the same instant in UTC and the current computer’s local zone. Date is the time reported by the sender. For a relay timestamp, use a Received header.
Chilkat AutoIt Downloads
Local $bSuccess = False
; Assumes Chilkat is unlocked. See Global Unlock Sample.
$oEmail = ObjCreate("Chilkat.Email")
$bSuccess = $oEmail.LoadEml("message.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
Local $sDateHeader = $oEmail.GetHeaderField("Date")
$oWhen = ObjCreate("Chilkat.CkDateTime")
$bSuccess = $oWhen.SetFromRfc822($sDateHeader)
If ($bSuccess <> True) Then
ConsoleWrite("Failed: when.SetFromRfc822." & @CRLF)
Exit
EndIf
ConsoleWrite("Header: " & $sDateHeader & @CRLF)
ConsoleWrite("UTC: " & $oWhen.GetAsTimestamp(False) & @CRLF)
ConsoleWrite("Local: " & $oWhen.GetAsTimestamp(True) & @CRLF)