I'm not a fan of the decimal time format... in my first attempts to convert I had to be wary of translating 19.99 properly into 8:00pm (or 7:59pm) instead of 7:60pm.
Alnoor's
CurrentTime code is how I normally approach it in a vbscript.
Tip: in Crystal, there is a nice formula to convert a Sage time field to something human readable.
TimeValue(ToNumber({CI_Item.TimeCreated})/24)------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 02-05-2019 17:00
From: Alnoor Cassim
Subject: oSession properties for Time
You can use the GetStampInfo() method, same one that gets the TimeUpdated for many tables.
sTimeNow = ""
retVal = oSession.GetStampInfo(oSession.UserKey, oSession.SystemDate, sTimeNow)
The only thing is let's say it's 7:45pm. sTime will return "19.75" so you have to convert the decimal to "19.45" or "7:45pm" if you want the "minutes in a hour" representation.
Otherwise just do this:
CurrentTime = Right("0" & Hour(Now),2) & ":" & Right("0" & Minute(Now),2) 'e.g. 19:45 means 7:45pm not decimal .75
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email: alnoor@callforhelp.biz
Orange County, CA
------------------------------