What are the specific formats of Flex date formatting
This article is about the specific format of Flex Date Format. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Flex Date Format
In Flex, labelFunction format is used in list controls such as datagrid. Various text messages, such as events, can be formatted with mx:dateformatter, but programmatic formatting is used in many encodings, but formatting in Flex
There are some differences between the various parameters of Java and Java, causing programmers who have used Java to have a headache. The format that can be named in Java is not passed in Flex: Please see the application of various formatting expressions below:
For example, minutes in Flex use NN to express various formats
privatestaticvardateFormatter:DateFormatter=newDateFormatter();
/◆◆
◆Flex date formatting, encapsulating mx.formatters.DateFormatter class
Additional text can be added to the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters.
Capitals should be avoided because they can be interpreted as pattern letters.
Flex Date Format Year
◆YY=05
◆YYYY=2005
◆YYYYY=02005
Months of the year
◆M=7
◆MM=07
◆MMM=Jul
◆MMMM=July
Date in January
◆D=4
◆DD=04
◆DD=10
Days of the week
◆E=1
◆EE=01
◆EEE=Mon
◆EEEE=Monday
Aam/pm marks in Flex date formatting.
◆
Number of hours in a day (0-23).
◆
H Number of hours in a day (1-24).
◆
Number of hours in Kam/pm (0-11).
◆
Hours in Lam/pm (1-12).
Minutes in hour
◆N=3
◆NN=03
Flex Date Format Seconds in Minutes
◆SS=30
◆
◆@paramvalue Date
◆@paramformatString format
◆@paramreturn String in the specified format
◆/
publicstaticfunctionformatDate(value:Object,formatString:String="YYYY-MM-DD"):String{ if(value==null||StringUtil.trim(value.toString()).length