Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the specific formats of Flex date formatting

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report