Date Time Formats

Post Reply
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Date Time Formats

Post by don lowenstein »

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
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Date Time Formats

Post by Rick Lipkin »

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
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Re: Date Time Formats

Post by don lowenstein »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Date Time Formats

Post by nageswaragunupudi »

Code: Select all

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
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Re: Date Time Formats

Post by don lowenstein »

Many Thanks.
Don Lowenstein
www.laapc.com
Post Reply