开发者

flex - querying a date var and changing minutes

开发者 https://www.devze.com 2023-03-19 10:13 出处:网络
I\'m trying to find out what the time is through a Date var and changing the hours in it. Does anyone know how to do that? I guess in 开发者_Go百科pseudo-code i would like something like this:

I'm trying to find out what the time is through a Date var and changing the hours in it. Does anyone know how to do that? I guess in 开发者_Go百科pseudo-code i would like something like this:

function updateTime(d:Date)Void
{
  Var nowTime:Date() = new Date();
  if (d.getHour() < nowTime.getHour()+1)
     d = nowTime;
}

Thanks!


if you want to change hours there is a function setHours(). Than it will be like this :

d.setHours(nowTime.getHour());
0

精彩评论

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

关注公众号