开发者

Flash - current time plus 30 minutes

im really new to flash, how do i go about creating a开发者_如何学运维 variable which will get the current date and time and add 30 minutes to it ?

thanks


This should do the trick.

var min:Number = 30;
var mSecs:Number = min * 60 * 1000;
var sum:Number = mSecs + date.getTime();

var newTime:Date = new Date(sum);

You can see some examples of turning this into functions you can reuse as well on Adobe's livedocs website.


This gets today's date and adds 30 minutes to it.

var mydate:Date = new Date();
mydate.setMinutes(mydate.getMinutes() + 30);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜