flex - querying a date var and changing minutes
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());
精彩评论