Get date and time format from the Robot

This sample might help you URCap Sample: Get Controller Time in URScript