Skip to main content
Jan 5, 2011 8:28 PM UTC
Question

Can't access properties of Date Object

My FMS client is calling a function (simplified) which gets the offset time in milliseconds of an flv file.  According to the docs for creationTime, it should return a Date object containing the time the file was created.  I cannot access any properties of the date object in the server script.

For example

Client.prototype.listFiles = function( folderName ) { 


     var testFile = new File('/streams/folder/fileName.flv');

     trace("creationTime: " + testFile.creationTime);

     trace("milliseconds: " + testFile.creationTime.time);



     return 'should be milliseconds offset';

}

prints (to the trace)

creationTime: Sat Jan 01 2011 19:00:23 GMT-0300 (SA Eastern Standard Time)

milliseconds: undefined

It does not appear to be possible to access the properties of any Date object.  The following prints nothing:

var currentTime = new Date();

for (var prop in currentTime)
    trace(prop);

Am I missing something?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Participating Frequently
    Jan 6, 2011 5:02 AM UTC

    You need to use testFile.creationTime.getTime() instead of testFile.creationTime.time.

    Translate
    Jan 6, 2011 7:01 AM UTC

    Happy face. 

    Translate