A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Casting to Date doesn't work ?!

Threaded View

  1. #1
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560

    Casting to Date doesn't work ?!

    Hm, i am trying to cast a variable of the type Object to the type Date

    PHP Code:
    var cookie SharedObject.getLocal("50FirstDates");
    cookie.data.myDate Object(new Date(1969,11,30));
    var 
    d:Object cookie.data.myDate;
    if (
    instanceof Date) {
        
    trace(Array(d));// works
        
    trace(String(d));// works
        
    trace(Number(d));// works
        
    trace(Date(d));// doesn't work

    I got my variable "d" here, which is actually an instance of Date
    and can't use it as a Date, what am i missing?

    Any ideas for a workaround?

    [edit]
    In line 2 i need the date stored as an Object,
    as i use a custom cookie handler class...
    Last edited by McUsher; 11-26-2005 at 08:56 AM.
    My letters on the F1 key have faded, how are yours today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center