FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Date Time Formats
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Date Time Formats
Posted: Fri Feb 01, 2019 01:16 AM

Is a function available to create a date/time string in the following format? I'm not too sure about data to the right of "13:39" in the sample below.

"01/31/2019 15:39:52.233-05:00"

thanks in advance.

Don Lowenstein
www.laapc.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Date Time Formats
Posted: Fri Feb 01, 2019 03:03 PM

Don

I don't know if this is what you are looking for ?

dtoc(date())+" "+Time()

The above may not carry out the time string that you may be looking for ..

Rick Lipkin

ps .. noticed you have an 816 area code .. I am a Kansas City native .. recognized the area code

Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: Date Time Formats
Posted: Fri Feb 01, 2019 07:01 PM

Thanks for the reply, RIck.

I will have to settle for the date() + time() for now.
yes - I'm in the KC area - Cameron Mo - north about 50 miles.

I see from the join dates to this forum we've both have been long time Fivewin supporters.

Don

Don Lowenstein
www.laapc.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Date Time Formats
Posted: Fri Feb 01, 2019 07:38 PM
Code (fw): Select all Collapse
function somename
   local tDateTime := DateTime()

   ? TTOC( tDateTime ) + FW_TIMEZONE()
   // for India now 02-02-2019 01:06:20.369-05:30

return nil

function FW_TIMEZONE()

   local n  := -HB_UTCOFFSET()

return If( n < 0, "-", "+" ) + LEFT( SECTOTIME( ABS( n ) ), 5 )


Useful functions
HB_UTCOFFSET()
HB_TSTOUTC( tDateTime ) --> Current UTC Time
Regards



G. N. Rao.

Hyderabad, India
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
Re: Date Time Formats
Posted: Fri Feb 01, 2019 08:40 PM

Many Thanks.

Don Lowenstein
www.laapc.com

Continue the discussion