rushed this out but may help. Remember utc
you could extend the rules and then these would appear in the function dropdown. This would allow you to use objectscript to return the starttime and another method to return the enddatetime.
You'd need to focus on yr default values in case any "in" values are invalid and for the second method - the 'duration' is this always in seconds?
e.g
Class GEN.Transform.cusFunctions Extends Ens.Rule.FunctionSet [ ProcedureBlock ]
{
ClassMethod retStartTime(in1 As %String = "", in2 As %String = "") As %String
{
s ret="" //default value?
q:in1="" ret
q:in2="" ret
s ret=$zdt($zdth(in1_" "_in2,4),3,7)
q ret
}
ClassMethod retEndTime(in1 As %String = "", in2 As %String = "", in3 As %String = "") As %String
{
s ret="" //default value?
q:in1="" ret
q:in2="" ret
q:in3="" ret
//need to determine if in3 is always in seconds - if yes then following may work
s dt=$zdth(in1_" "_(in2),4)
s $p(dt,",",2)=$p(dt,",",2)+in3
s ret=$zdt(dt,3,7)
q ret
}
-------
test from terminal
BPTLIVE>w in1
07/05/2022
BPTLIVE>w in2
14:30
BPTLIVE>w in3
30
BPTLIVE>w ##Class(GEN.Transform.cusFunctions).retStartTime(in1,in2)
2022-05-07T13:30:00Z
BPTLIVE>w ##Class(GEN.Transform.cusFunctions).retEndTime(in1,in2,in3)
2022-05-07T13:30:30Z
BPTLIVE>
rushed this out but may help. Remember utc you could extend the rules and then these would appear in the function dropdown. This would allow you to use objectscript to return the starttime and another method to return the enddatetime. You'd need to focus on yr default values in case any "in" values are invalid and for the second method - the 'duration' is this always in seconds? e.g Class GEN.Transform.cusFunctions Extends Ens.Rule.FunctionSet [ ProcedureBlock ] { ClassMethod retStartTime(in1 As %String = "", in2 As %String = "") As %String { s ret="" //default value? q:in1="" ret q:in2="" ret s ret=$zdt($zdth(in1_" "_in2,4),3,7) q ret } ClassMethod retEndTime(in1 As %String = "", in2 As %String = "", in3 As %String = "") As %String { s ret="" //default value? q:in1="" ret q:in2="" ret q:in3="" ret //need to determine if in3 is always in seconds - if yes then following may work s dt=$zdth(in1_" "_(in2),4) s $p(dt,",",2)=$p(dt,",",2)+in3 s ret=$zdt(dt,3,7) q ret } ------- test from terminal BPTLIVE>w in1 07/05/2022 BPTLIVE>w in2 14:30 BPTLIVE>w in3 30 BPTLIVE>w ##Class(GEN.Transform.cusFunctions).retStartTime(in1,in2) 2022-05-07T13:30:00Z BPTLIVE>w ##Class(GEN.Transform.cusFunctions).retEndTime(in1,in2,in3) 2022-05-07T13:30:30Z BPTLIVE>