Prev | Current Page 130 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

You look at how haXe deals with functions in the next
chapter.
format()
The format function provides the reverse functionality of the Date.fromString() method, whereby
you supply the Date object and a string representing the format of the date you want to output, and
the function will return a string containing your newly processed date. The format string will accept
any values as specified in the strftime standard, with the exception of month names because of
internationalization issues. Table 3 - 7 details the accepted string tokens used to determine the
output format.
Part I: The Core Language
54
Table 3-7
Token Description
%a Abbreviated weekday name (e.g., Fri)
%A Full weekday name (e.g., Friday)
%b Abbreviated month name (e.g., Oct)
%B Full month name (e.g., October)
%c The standard date and time string
%d Day of the month, as a number (1??“31)
%H Hour, 24-hour format (0??“23)
%I Hour, 12-hour format (1??“12)
%j Day of the year, as a number (1??“366)
%m Month as a number (1??“12)
%M Minute as a number (0??“59)
%p Locale??™s equivalent of A.


Pages:
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142