YYYYMMDD HHMMSS
So for today
20100304 173000
But when I do:
var todayStr:String = today.getFullYear()+today.getMonth()+today.getDay()+today.getHours()+ today.getMinutes();
The problem is that getMonth() sends “3” in March, and I think “03”. I have the same problem this day.
What should I do?
Thank you.
var formatter: DateFormatter;
formatter = new DateFormatter();
formatter.formatString = "YYYYMMDD HHNNSS";
formatter.format(dateInstance);
Beware of the use of’N’ in minutes
I have an appointment and I want to format the date:
YYYYMMDD HHMMSS
So for today
20100304 173000
But when I do:
var todayStr: String = today.getFullYear()+today.getMonth()+today.getDay()+today.getHours()+today.getMinutes();
The problem is that getMonth() sends “3” in March , I want to “03”. I have the same problem this day.
What should I do?
Thank you.
You can use DateFormatter. Take a look at this: Dateformatter @ adobe
< /p>
var formatter: DateFormatter;
formatter = new DateFormatter();
formatter.formatString = "YYYYMMDD HHNNSS";
formatter.format(dateInstance);
Beware of the use of’N’ in minutes