Jump to content


Stephen Morrison

Member Since 04 Mar 2003
Offline Last Active Sep 17 2010 04:18 PM
-----

Posts I've Made

In Topic: CTIME and CDATE Help

22 August 2008 - 04:00 PM

I am new to PRO IV and need some help. I am trying to take a date and time and add 5 minutes to it and then compare it to the current date and time. It works except between 23:55 and 00:00.

Here is my code:

$CURDATETIME = CDATE(@DATE,'MMDDYYYY') + @TIME
IF $EDION = 'Y'
$ONTIME = $ONDATETIME(9,14)
#ONTIME = CTIME($ONTIME) + CTIME('000500')
$ONTIME = CTIME(#ONTIME)
$ONDATETIME = $ONDATETIME(1,8) + $ONTIME
IF $CURDATETIME > $ONDATETIME
etc....
Any suggestions on how I can use the date and time together to account for the date change would be greatly appreciated!

Thanks in advance,
David

Dave 


Because CTIME converts the time into a fraction of the date you can use sometime like this



#CURRENT_DATE_TIME = #CURRENT_DATE + CTIME($CURRENT_TIME)

#ON_TIME = #CURRENT_DATE_TIME + CTIME('000500')

#ON_DATE = INT(#ON_TIME)

#ON_TIME = FRAC(#ON_TIME)

$ON_TIME = CTIME(#ON_TIME)



Hope this is of some help 



Steve