Time

Christian Bryan

New Member
Is there an elegant method of converting time as represented by a string back to an integer value.

Cheers

Christian

I wish all development was done in Smalltalk,
Progress sucks most of the time.
 

madpaulo

New Member
<BLOCKQUOTE><font size="1" face="Arial, Verdana">quote:</font><HR>Originally posted by Christian Bryan:
Is there an elegant method of converting time as represented by a string back to an integer value.
<HR></BLOCKQUOTE>

Presuming the string is in HH:MM:SS format, it'd be
<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre><FONT face="Courier New">
t = integer(substr(s,1,2)) * 3600 +
integer(substr(s,4,2)) * 60 +
integer(substr(s,7) no-error.
</FONT f>[/code]
 

Chris Kelleher

Administrator
Staff member
Christian-

The example above given by madpaulo is the easiest way to do this now. However, Progress is considering a date/time datatype along with improved functions for handling dates and times.

I would recommend going to the Progress Enhancement Request Systems and search for the following: #1072 Date/Time Stamp, #1126 Add new Datatypes and #1143 Date/Time Functions. They all have a large number of votes, and I am sure any added votes and comments would be appreciated.

Remember, this is the official way to let Progress know what you would like enhanced


Hope this helps,
-Chris

------------------
Chris Schreiber
ProgressTalk.com Manager
chris@fast4gl.com
 
Top