FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour time with milliseconds
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
time with milliseconds
Posted: Sat Mar 14, 2020 01:48 PM

Does a function exist which returns the time with milliseconds?

Don Lowenstein
www.laapc.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: time with milliseconds
Posted: Sat Mar 14, 2020 03:28 PM
Code (fw): Select all Collapse
? DateTime() // --> 14-03-2020 20:56:20.355
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: time with milliseconds
Posted: Sat Mar 14, 2020 03:50 PM
Please keep this function:
Code (fw): Select all Collapse
function TIME_MS()

#ifdef __XHARBOUR__
   local cTime := TTOC( DateTime(), 2 )
#else
   local cTime := HB_TTOC( HB_DateTime(), "", "HH:MM:SS:FFF" )
#endif

return cTime


? TIME_MS() will return a time string in format HH:MM:SS.CCC with milliseconds
Regards



G. N. Rao.

Hyderabad, India
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: time with milliseconds
Posted: Sat Mar 14, 2020 10:48 PM

Many Thanks.

Don Lowenstein
www.laapc.com

Continue the discussion