Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Wiki Page: Returning a timestamp in milliseconds

$
0
0
There is no built in function to return and format the time to the millisecond because GetCurrentTime only goes to the second and FormatDateTime doesnt have the ability to include milliseconds; but with a combination of these functions and the GetTimestamp function it is possible to code a solution: @codepage(1252) benchmark SilkPerformerRecorder use "WebAPI.bdh" use "kernel.bdh" dcluser   user     VUser   transactions     TMain           : 1; dclfunc   function fDocCreateDate  : string           var           nDate, nTime : number;           sDateTime, sMill : string;           begin           sMill := GetTimeStamp(TIMESTAMP_GMT | TIMESTAMP_IN_MS);           Substr(sMill, sMill, 11, 2);           nDate := GetCurrentDate();           nTime := GetCurrentTime();           FormatDateTime(nDate, nTime, "%d/%m/%Y %H.%M.%S."+sMill, sDateTime);           fDocCreateDate := sDateTime;           end fDocCreateDate; dcltrans   transaction TMain   var     sDateTime : string;   begin     sDateTime:= fDocCreateDate();     Print ("dd/mm/yyyy hh.mm.ss.ms");     Print (sDateTime);   end TMain; You can change the FormatDateTime function to display the output in whatever order is required. Incident #2544072 Old KB# 35459 Created On:  06 February 2012

Viewing all articles
Browse latest Browse all 4084

Trending Articles



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