Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - [Matrix1] Timespan String Expressions

Author
Message
Chris Tate
DBPro Master
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 27th Jul 2015 10:50
This timespan snippet provides time based string conversion from a provided measure of time in milliseconds. These functions can be used to quickly build strings for application messages or user interface elements which need to reflect a certain amount of time elapsed.

Use Timespan$() to convert a number of milliseconds into a formatted time string. For example, 65000 milliseconds will return "00:01:05", that is 0 hours, 1 minute and 5 seconds.

Use the ToSeconds$(), ToMinutes$() and ToHours$() expressions to return the number of seconds, minutes or hours respectively. The ToSecond function requires an additional parameter, the number of decimal points to return; so that a more precise reflection can be returned when expressing small durations of time, such as 0.5 seconds which is 500 milliseconds.

+ Code Snippet

Login to post a reply

Server time is: 2017-07-22 03:53:25
Your offset time is: 2017-07-22 03:53:25