PRO
dbeard
USA
Asked
— Edited
if I run this command:
$xhours = FmtTimeSpan(CDateTime("10/29/2016 1:00:00 PM") - CDateTime("10/31/2016 2:02:02 PM"), "hh")
I get 1. Which works great. And says that 2 pm is 1 hour from 1 pm.
But if I run this
$xhours = FmtTimeSpan(CDateTime("10/29/2016 3:00:00 PM") - CDateTime("10/31/2016 2:02:02 PM"), "hh")
I get 1. But not a negative 1 or even 0.
I am trying to figure out if the time is past or before the current time.
Any help would be appreciated
Experimenting, if your time span exceeds 24 hours, it will not display the hours.
Can you explain more on what you are trying to do specifically? Are you wanting to take an action is a time/date has past?
if the time/date is in the past I would like to take an action, execute a script or execute another if the date/time is in the future.
I know how to write the script based on the outcome of the time/date. Just cant figure a way to figure out if past or future time/date.
@Dbeard,
For a moment i thought it was the same question you asked on this thread:
https://synthiam.com/Community/Questions/9760
there, you have all the elements to help you, sometimes is not so obvious ...
solution:
Let me know if it solves your problem.
PTP:
Yes, it worked wonderfully. And cut down some of the code I had put together.
And I also learned the GetCharAt code also. A bonus.
Thanks very much.