| Package | qnx.utils |
| Class | public final class TimeFormatter |
| Inheritance | TimeFormatter Object |
TimeFormatter class contains utility methods that format a given number (seconds or milliseconds) into a time value.
The Number is returned as a String in the following format: HH:MM:SS, where the hours column is optional.
Given the following variable and method call:
myNumber = new Number();
myNumber = 86300;
TimeFormatter.formatSeconds(myNumber, true );
the following String is returned: 23:58:20.
Given the following method call (using the same variable and value):
TimeFormatter.formatMilliseconds(myNumber, true);
the following String is returned: 0:1:26.
| Method | Defined By | ||
|---|---|---|---|
formatMilliseconds(milliseconds:Number, addHours:Boolean = false):String [static]
Returns a String in the format hours:mins:secs given a Number. | TimeFormatter | ||
formatSeconds(seconds:Number, addHours:Boolean = false):String [static]
Returns a String containing the number of seconds in a given Number. | TimeFormatter | ||
| formatMilliseconds | () | method |
public static function formatMilliseconds(milliseconds:Number, addHours:Boolean = false):String
Returns a String in the format hours:mins:secs given a Number.
Parameters
milliseconds:Number — The Number for which to return the formatted String.
| |
addHours:Boolean (default = false) — Set to true to add the hours column to the output String.
|
String — A colon-delimited String containing the Number expressed in hours, minutes, and seconds.
|
See also
| formatSeconds | () | method |
public static function formatSeconds(seconds:Number, addHours:Boolean = false):String
Returns a String containing the number of seconds in a given Number.
Parameters
seconds:Number — The Number for which to return the formatted String.
| |
addHours:Boolean (default = false) — Set to true to add the hours column to the output String.
|
String — A colon-delimited String containing the Number expressed in hours, minutes, and seconds.
|
See also