Joe,
For a datetime value, subtracting the zero hour value of the day will return the number of seconds.
That is
m.CurrentTimeInSeconds = DATETIME() - DTOT(DATE())
To use it in an Excel sheet as a time value, you must convert it to a fraction of a day
m.ExcelCurrentTimeInSeconds = m.CurrentTimeInSeconds / 86400
Representing this in Excel in a cell formatted as a time value, will display something like 18:01:15.
On Mon, Jul 26, 2021 at 5:37 PM Joe Yoder joe@wheypower.com wrote:
I want to build a cursor of time fields for export to Excel. The DateTime format allows a simple for next loop to increment the time value by a specified number of seconds.
Is there a function that allows the extraction of the time portion of a DateTime variable as a time value not as a string? It seems one could pull out the hours and minutes as characters and convert them to time via CTOT but this results in a DateTime result with an embedded date.
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]