You are totally right :

var /** @type {Date} */ d1 = new Date();
d1.setHours(d1.setMinutes(d1.setMilliseconds(0)));
org.apache.royale.utils.Language.trace("d1->" + d1.getTime());

Le 2022-05-18 23:26, Greg Dove a écrit :

Please report that as an issue. For the first one, I assume it is
generating something like d1.setHours(d1.setMinutes(d1.setMillseconds(0))) ? That is going to cause problems, because each of those methods returns
the 'getTime()' value, and not the value that was set.

On Thu, May 19, 2022 at 9:12 AM <cont...@cristallium.com> wrote:

Hi All,

I notice something strange  (using sdk 0.9.9), take this code :

var d1:Date = new Date();
d1.hours = d1.minutes = d1.milliseconds = 0;
trace ("d1->" + d1.getTime());

var d2:Date = new Date();
d2.hours = 0;
d2.minutes = 0;
d2.milliseconds = 0;
trace ("d2->" + d2.getTime());

It will show this result :

d1->NaN
d2->1652824822000

Do I need to report this as an issue ? or X = Y = Z = 0 is a bad
practice in as3 (or I'm wrong using Date ?) ?

Regards
Fred

Reply via email to