开发者

Flash - current time plus 30 minutes

开发者 https://www.devze.com 2022-12-24 19:49 出处:网络
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 ?

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

精彩评论

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