Progress time as INTEGER converted to C# timespan?

Posted by MBeynon on 26-Sep-2017 05:47

Hi,

Is it possible to convert two OE time integers (1234 and 1235 for example) to a string representation of a c#  Timespan without using .NET (I'm on Unix).

Thank you.

All Replies

Posted by Garry Hall on 26-Sep-2017 08:52

There is no in-built ABL functionality to do this, if that is what you are asking. You would have to provide that implementation yourself (FWIW, I saw that the MSDN doc on TimeSpan has a link to the source).

Posted by Richard.Kelters on 26-Sep-2017 12:38

Are looking for this: STRING(TIME,"HH:MM:SS") ?

DEFINE VARIABLE TS AS System.TimeSpan NO-UNDO.

TS = NEW System.TimeSpan(TIME * System.TimeSpan:TicksPerSecond).

MESSAGE STRING(TIME,"HH:MM:SS") skip

TS:ToSTring()

VIEW-AS ALERT-BOX.

Posted by MBeynon on 27-Sep-2017 03:46

Hi,

Unfortunately, I'm working on a Un*x box so System.Timespan is not available to me.

Posted by Stefan Drissen on 27-Sep-2017 04:21

Richard's point, is that STRING( TIME, "HH:MM:SS" ) returns the same value as the .Net TimeSpan.

---------------------------

Message

---------------------------

11:21:14

11:21:14

---------------------------

OK  

---------------------------

Posted by MBeynon on 27-Sep-2017 04:39

Ah, OK, thanks!

This thread is closed