Skip to main content
January 5, 2011
Question

Can't access properties of Date Object

  • January 5, 2011
  • 1 reply
  • 530 views

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 has been closed for replies.

    1 reply

    Participating Frequently
    January 6, 2011

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

    January 6, 2011

    Happy face.