Date Time Formats

Date Time Formats

Postby don lowenstein » Fri Feb 01, 2019 1: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
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: Date Time Formats

Postby Rick Lipkin » Fri Feb 01, 2019 3: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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Date Time Formats

Postby don lowenstein » Fri Feb 01, 2019 7: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
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: Date Time Formats

Postby nageswaragunupudi » Fri Feb 01, 2019 7:38 pm

Code: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Date Time Formats

Postby don lowenstein » Fri Feb 01, 2019 8:40 pm

Many Thanks.
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 39 guests