qnx.fuse.ui.utils.TimeFormatter

TimeFormatter

Methods


Packageqnx.fuse.ui.utils
Classpublic final class TimeFormatter
InheritanceTimeFormatter Inheritance Object

The 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.



Class information:
BlackBerry 10 Version:   10.0.0



Public Methods

 MethodDefined 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

Method Detail

formatMilliseconds()


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.

Returns

String — A colon-delimited String containing the Number expressed in hours, minutes, and seconds.

See also

formatSeconds()

formatSeconds()


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.

Returns

String — A colon-delimited String containing the Number expressed in hours, minutes, and seconds.

See also

formatMilliseconds()





comments powered by Disqus