View source

class thx.format.TimeFormat

Available on all platforms

Class Fields

static function customFormat(t:Time, pattern:String, ?culture:Culture):String

Custom time format.

static function format(t:Time, pattern:String, ?culture:Culture):String

Formats the time using a one letter formatting option or using a custom pattern.

patterndescription
cconstant format (not culture specific)
gtshort time pattern
GTlong time pattern
...custom pattern. It splits the pattern into pattern terms and apply them individually

See formatTerm for all the possible formatting options to use for custom patterns.

static function formatTerm(t:Time, pattern:String, ?culture:Culture):String

Returns a formatted date according to the passed term and culture. The pattern parameter accepts the following modifiers in either Microsoft format or strftime format.

formatdescriptionexample
dThe number of days7
ddLeft padded number of days (between 2 and 8 characters)07
ddddddddThe number of days padded left with zeroes up to 8.00000007
hThe number of whole hours in the time interval that are not counted
as part of days.11
hhThe number of whole hours in the time interval that are not counted
as part of days. Single-digit hours have a leading zero.07
HThe number of whole hours in the time interval.11
HHHHHHHHThe number of whole hours in the time interval. Left padded with 000000007
mMinutes (0 to 59).7
mmThe number of whole minutes in the time interval that are not07
included as part of hours or days. Single-digit seconds have a
leading zero.
sSeconds (0 to 59).7
ssThe number of whole seconds in the time interval that are not07
included as part of hours, days, or minutes. Single-digit seconds
have a leading zero.
fOutputs the tenth of a second.
fffffffOutputs up to the tenth of a microsecond. the tenth of a second.
FOutputs the tenth of a second.
FFFFFFF
:Time separator.%
'...'Single quoted text is not processed (except for removing the quotes)...
"..."Double quoted text is not processed (except for removing the quotes)...

static function invariantTimeLong(time:Time):String

static function iso8601OffsetShort(offset:Time):String

static function offsetHoursLong(offset:Time, ?culture:Culture):String

static function offsetHoursShort(offset:Time, ?culture:Culture):String

static function offsetLong(offset:Time, ?culture:Culture):String

static function timeLong(time:Time, ?culture:Culture):String

Long time format.

static function timeShort(time:Time, ?culture:Culture):String

Short time format.

Toggle inherited fields