Util: Format Time (18)
Run Both Together
A1: Variable Set [ Name:%type To:civ Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%time_in To:%par1 Do Maths:Off Append:Off ]
A3: If [ %par2 Is Set ]
A4: Variable Set [ Name:%params To:%par2 Do Maths:Off Append:Off ]
A5: Variable Split [ Name:%params Splitter:, Delete Base:Off ]
A6: Variable Set [ Name:%type To:%params1 Do Maths:Off Append:Off ] If [ %params1 Is Set ]
A7: Variable Set [ Name:%delimiter To:%params2 Do Maths:Off Append:Off ] If [ %params2 Is Set ]
A8: End If
A9: Variable Split [ Name:%time_in Splitter:. Delete Base:Off ]
A10: Variable Set [ Name:%hour To:%time_in1 Do Maths:Off Append:Off ]
A11: Variable Set [ Name:%minutes To:%time_in2 Do Maths:Off Append:Off ]
A12: If [ %type ~ civ ]
A13: If [ %hour > 11 ]
A14: Variable Set [ Name:%hour To:%hour-12 Do Maths:On Append:Off ] If [ %hour > 12 ]
A15: Variable Set [ Name:%suffix To:pm Do Maths:Off Append:Off ]
A16: Else
A17: Variable Set [ Name:%hour To:12 Do Maths:Off Append:Off ] If [ %hour = 0 ]
A18: Variable Set [ Name:%suffix To:am Do Maths:Off Append:Off ]
A19: End If
A20: End If
A21: Variable Set [ Name:%return To:%hour%delimiter%minutes Do Maths:Off Append:Off ] If [ %delimiter Is Set ]
A22: Variable Set [ Name:%return To:%hour%minutes Do Maths:Off Append:Off ] If [ %delimiter ! Set ]
A23: Variable Set [ Name:%return To:%suffix Do Maths:Off Append:On ] If [ %suffix Is Set ]
A24: Return [ Value:%return Stop:On ]
Keith