Skip to main content
Known Participant
February 10, 2011
Question

Buritto/Hero 4.5 (MobileApplication) Date Class buggy

  • February 10, 2011
  • 2 replies
  • 616 views

OMG I hope it's me!

var startDate:Date = new Date(2010, 12, 31, 23, 59, 59, 999);
var endDate:Date = new Date(2011, 12, 31, 24, 00, 00, 00);
var realDate:Date = new Date();

trace("startDate:" + startDate.toDateString() + "  " + startDate.toTimeString());

trace("endDate:" + endDate.toDateString() + "  " + endDate.toTimeString());

trace("realDate:" + realDate.toDateString() + "  " + realDate.toTimeString());

startDate:Mon Jan 31 2011  23:59:59 GMT-0800

endDate:Wed Feb 1 2012  00:00:00 GMT-0800

realDate:Thu Feb 10 2011  00:45:46 GMT-0800

startDate    Date (@90d6e01)   
    date    31 [0x1f]   
    dateUTC    1   
    day    1   
    dayUTC    2   
    fullYear    2011 [0x7db]   
    fullYearUTC    2011 [0x7db]   
    hours    23 [0x17]   
    hoursUTC    7   
    milliseconds    999 [0x3e7]   
    millisecondsUTC    999 [0x3e7]   
    minutes    59 [0x3b]   
    minutesUTC    59 [0x3b]   
    month    0   
    monthUTC    1   
    seconds    59 [0x3b]   
    secondsUTC    59 [0x3b]   
    time    1296547199999 [0x12de03c3bff]   
    timezoneOffset    480 [0x1e0]

endDate    Date (@90d6e21)   
    date    1   
    dateUTC    1   
    day    3   
    dayUTC    3   
    fullYear    2012 [0x7dc]   
    fullYearUTC    2012 [0x7dc]   
    hours    0   
    hoursUTC    8   
    milliseconds    0   
    millisecondsUTC    0   
    minutes    0   
    minutesUTC    0   
    month    1   
    monthUTC    1   
    seconds    0   
    secondsUTC    0   
    time    1328083200000 [0x13537ed6800]   
    timezoneOffset    480 [0x1e0]  

realDate    Date (@90d6e41)   
    date    10 [0xa]   
    dateUTC    10 [0xa]   
    day    4   
    dayUTC    4   
    fullYear    2011 [0x7db]   
    fullYearUTC    2011 [0x7db]   
    hours    0   
    hoursUTC    8   
    milliseconds    58 [0x3a]   
    millisecondsUTC    58 [0x3a]   
    minutes    48 [0x30]   
    minutesUTC    48 [0x30]   
    month    1   
    monthUTC    1   
    seconds    6   
    secondsUTC    6   
    time    1297327686058 [0x12e0ec181aa]   
    timezoneOffset    480 [0x1e0]  

realDate inspector in Flash Builder shows date 10 but day 4?

month is Feburary it shows 1

I'm sorry but this appears totally f'ed up to me?!!

I'll look into but I really don't think there is much I can do with this?

This topic has been closed for replies.

2 replies

as4moreAuthor
Known Participant
February 10, 2011

It's pretty confusing I found.

I suppose Date is right and my usage was wrong, which is what I hoped & expected.

day = (dow) day of week 0-6

date is the actual (dom) day of month 1-30ish

so Month ia also 0-11

Similarly to Sunday being zero it seems January is zero too.

Well again I hope this clarifies for someone else dazed and confused by it.

as4moreAuthor
Known Participant
February 10, 2011

getTIme() seems to be using day not date for the day?

I'm confused... I hope?!

You'll have to run the numbers too it must be were I'm miss calculating?

Maybe I can offset the month which seems wrong -1?

Rught so Day is dow or day of week with the date is the day of the month.

Still the getTime is using the day of the week to multiply the milliseconds returned from getTime() I think?

I suppose I can rebuild a new getTime() function for another on of my as3fix package classes.

Wait!!! What's this?
1016: Base class is final.    RealDate.as

You have got to be kidding me?!?

as4moreAuthor
Known Participant
February 10, 2011

Okay I did find my own code looking at day instead of date so that caused a lot of confusion.

Still now I'm seeing a month of 1 in February?

Is that because it's one month and so many days of January?

I guess so? o it seems I'll need to add one to the month myself and that's expected?

Well I hope this helps someone else I found it very confusing.