Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43889

Wiki Page: Is there a function that will take the current time and calculate the number of seconds that have elapsed since 00:00:00?

$
0
0
The script below shows a function that will take a paramater of the current time and calculate the number of seconds that elapsed since 00:00:00. //------------------------------------------------------------------- // Benchmark Script Template //------------------------------------------------------------------- // Author : Support // Date : Aug 04 // History: Function FormatTimeInSeconds takes a time (hh:mm:ss) and converts it to number of seconds that elapsed //------------------------------------------------------------------- Benchmark TimeDate use "kernel.bdh" dclfunc function FormatTimeInSeconds(sTimeIn: string ): number var sHours,sMinutes,sSeconds: string ; nSecondsOut: number ; begin // Parse Out Hours SubStr(sTimeIn,sHours, 1 , 2 ); write ( "Hours entered = " ); writeln ( number (sHours)); // Parse Out Minutes SubStr(sTimeIn,sMinutes, 4 , 2 ); write ( "Minutes entered " ); writeln ( number (sMinutes)); // Parse Out Seconds SubStr(sTimeIn,sSeconds, 7 , 2 ); write ( "Seconds entered " ); writeln ( number (sSeconds)); // Calculate the number of seconds nSecondsOut:=( number (sHours)* 60 * 60 )+( number (sMinutes)* 60 )+ number (sSeconds); FormatTimeInSeconds:=nSecondsOut; write ( "Time you entered converted to seconds is " ); writeln (nSecondsOut); end FormatTimeInSeconds; dcluser user VirtUser transactions TInit : begin; // Transactions Section dcltrans transaction TInit begin FormatTimeInSeconds( "01:00:00" ); //current time format hh:mm:ss end TInit; Old KB# 18351

Viewing all articles
Browse latest Browse all 43889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>