本文介绍了加入天在ActionScript日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们具有其中用户必须输入一个日期谁的值是当前的日期(在其上用户使用应用程序的日期)后没有超过30天的应用程序。这是一个Flash应用程序,因此我需要一种方式来增加30天至目前为止,并得到正确的日期。喜欢的东西在JavaScript:

We have an application in which the user has to enter a date who's value is no more than 30 days after the the current date (the date on which the user uses the application). This is a Flash application, therefore I need a way to add 30 days to the current date, and get the right date. Something like in JavaScript:

myDate.setDate(myDate.getDate()+30);

或者在C#:

Or in C#:

DateTime.Now.Add(30);

有没有在ActionScript这样的事?

Is there such a thing in ActionScript?

推荐答案

而其他的答案将工作我敢肯定,这是因为这样做容易:

While the other answers will work im sure, it is as easy as doing:

var dte:Date = new Date();
dte.date += 30; 
//the date property is the day of the month, so on Sept. 15 2009 it will be 15

如果有必要和年份以及这甚至会增加一个月。你可以做到这一点的月份和年份性能以及。

This will even increment the month if necessary and year as well. You can do this with the month and year properties as well.

这篇关于加入天在ActionScript日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 00:15