Re: Time variables
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 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] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/CADj74tEuL5PFROGeahDPj7zzkViAkwQU1L41QRw=5d65xyt...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
AW: Time variables
There is no "Time only" variable type in VFP. Thus, you'll need to go with a default date attached to your time portion. I normally use the 1.1.2020 for that. As long as you always use the same date part, your time calculations will be not affected from that additional baggage. In Excel you can just display the time part. wOOdy -Ursprüngliche Nachricht- Von: ProFox Im Auftrag von Joe Yoder Gesendet: Montag, 26. Juli 2021 18:36 An: profoxt...@leafe.com Betreff: Time variables 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] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/072201d7823e$3162a2d0$9427e870$@wondzinski.de ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Time variables
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 --- ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/cabqednv-ngcjrmfewpmbcgj59sep5y02q73fejhx-hbi_qu...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.