Tech Tip: How to obtain a time from an expression that combines a time with a number
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: July 14, 2000
When you perform an operation such as addition, subtraction, multiplication or division on a time expression, the result will depend on the operation. Any operation that involves a time expression and a number would return a result in the form of a number.
Here are the comparisons between 2 operations:
Operation
Syntax
Returns
Expression
Value
Addition
Time + Time
Time
?02:03:04? + ?01:02:03?
03:05:07
Addition
Time + Number
Number
?02:03:04? + 65
7449
As it shows, the first operation returns the result in the form of time expression while the second operation returns the result in the form of a number. If you want to obtain a time expression from the second operation, you must use the command Time string. The command Time string returns the string form of the time expression you pass in seconds.
Time String(?02:03:04? + 65) returns 02:04:09
Time String(7449) returns 02:04:09
Reference: Time Operators