Converting the given time to seconds

Dharmendra

New Member
Hi,

Could anyone please help me in converting the given time to seconds?
Do we have any function in progress to do this?

Ex: I have the time in the format of 22:38:42.
Now I need to convert 22:38:42 to seconds.

Regards,
Dharmendra
 

Stefan

Well-Known Member
You can pull the time apart with the entry function or you can leverage the interval function:
Code:
def var ctime as char no-undo initial "22:38:42".

message 
   interval( 
      datetime( "1/1/1T" + ctime  ), 
      datetime( "1/1/1" ) , 
      "seconds" 
   )
view-as alert-box.
 

tamhas

ProgressTalk.com Sponsor
There are many different answers, depending. Is the time you have a string or a date-time datatype or what.

Are you looking for seconds since midnight?
 

LarryD

Active Member
22:38:42 is a point in time on a given day. "Seconds" is a measure of some interval of time. What interval do you mean?

While true, it also could be an elapsed time of 22 hours 38 minutes and 42 seconds. That being said -- no clue as to what this individual is asking for.
 
Top