Flex Date and Time operations

Source: Internet
Author: User

First, it has only one date, but no time, so here is the end of the year, month, and day.
For example: CopyCode The Code is as follows: <mx: datefield id = "dfdapplytime" stylename = "formitemcss" formatstring = "YYYY-MM-DD"
Daynames = "[Day, one, two, three, four, five, six]"
Monthnames = "[January, February, March, April, May, June, July, August, September, October]"
Editable = "false"
/>

at this time, you can process the display format as needed, such as DD/MM/YYYY. note that there is no such thing as hh: NN: SS, but it can be used for processing.
This is why I feel depressed.
however, I can solve the problem by adding a few more boxes, but it is troublesome. see copy the Code as follows:

selecteddate = "{new date ()} "
formatstring =" YYYY-MM-DD "
daynames =" [Day, one, two, three, four, five, six] "
monthnames =" [January, february, March, April, May, June, July, August, September, October, November, December] "/>





Second, you can do the same. If you want to initialize the time interval, you can do the same. Here we also provide the time processing method. That is, dateformatter can use it to format the time. For example:Copy codeThe Code is as follows: var et: Date = new date ();
VaR N: Number = 1000*60*60*24*30;
VaR ST: Date = new date (ET. Time + n );
VaR DF: dateformatter = new dateformatter ();
DF. formatstring = 'yyyy/MM/dd hh: NN: ss ';
VaR ST1: String = DF. format (ST );
Alert. Show (ST1 );

You can also use controls to achieve the same effect. These functions can be used to meet the requirements. However, if there is no time, minutes and seconds, it is really difficult to use them. I hope to write a control next time for processing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.