I have been trying to integrate AHK into my daily life for past few weeks and now working on trying to get the script read my emails and post the information about the currently selected email into another program.
Basically doing sort of a report on the incoming emails.
anyway, I am running into an issue where I cannot get the formatting of the time right.
I am trying to get the time of the incoming email formatted to only hours and minutes.
With the script below I am able to pull the time the email came into the inbox in the Outlook and assign it to the variable: CreationTime
but for some reason when I try to change it to HH:mm, all I get is 00:00
Here is my script, please help if you can.
oApp := ComObjActive("Outlook.Application") ; Get Outlook
oExp := oApp.ActiveExplorer ; Get the ActiveExplorer.
oSel := oExp.Selection ; Get the selection.
oItem := oSel.Item(1) ; Get a selected item.
CreationTime := oItem.CreationTime
FormatTime, TTime, %CreationTime%, HH:mm
MsgBox, %CreationTime%`n%TTime%
return
Message box gives me two lines:
3/5/2017 7:15:25 PM
00:00
The TTime is where I am trying to format it to keep only hours and minutes but all I get is zeros
formatting time - noob question
Re: formatting time - noob question
Could the problem be in the format of the CreationTIme variable...per documentation:
"Transforms a YYYYMMDDHH24MISS timestamp into the specified date/time format."
Your timestamp for this variable comes out as:
"3/5/2017 7:15:25 PM"
"Transforms a YYYYMMDDHH24MISS timestamp into the specified date/time format."
Your timestamp for this variable comes out as:
"3/5/2017 7:15:25 PM"
Re: formatting time - noob question
Thank you for the help, that was it, since I am new to this and coding to begin with, it's a struggle for me, but I was able to make it work with the help of DateParse code posted by polyethene. Thanks for pointing out the obvious to me.
Who is online
Users browsing this forum: Bing [Bot], Chunjee, Google [Bot], mstrauss2021 and 281 guests