Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1340] Getting the timestamp of a local file - Titanium.Filesystem.File.createTimestamp

GitHub Issuen/a
Resolution Date2011-04-17T01:55:54.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
Labelsandroid, createtimestamp, defect, ti.modules.titanium.filesystem, titanium.filesystem.file
Reportermarco.schierhorn (at gmail)
AssigneeDon Thorp


Im trying to get the timestamp of the creation date of a File.
But when im using the Function createTimestamp() im getting the error:

italicType error:Cannot find function createTimestamp in object ti.modules.titanium.filesystem FileProxy@43ba7e00italic

Im reporting this issue on Android using Titanium SDK 1.3.0 and Android SDK 2.1.
Currently im only testing it on the SDK/Emulator and not on a real phone.

Is something wrong in my code below?

var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename);
    if ( file.exists() )
        timeStampOfFile = file.createTimestamp();


  1. Don Thorp 2011-04-15

    modificationTimestamp was missing as well. Note on Android file stored in Resources have no accessible timestamp. These methods may only be used for files written to the device/emulator.

  2. Don Thorp 2011-04-15

    (from [569f3e768e745ac3294308e17550be6bdf312919]) [#1340 state:resolved] exposed support for createTimestamp and modificationTimestamp on the File proxy. Note: files in the Resources folder will not have timestamps when compiled for device. http://github.com/appcelerator/titanium_mobile/commit/569f3e768e745ac3294308e17550be6bdf312919"> http://github.com/appcelerator/titanium_mobile/commit/569f3e768e745...

  3. Joe Maffia 2011-04-15

    Just upgraded to 1.4.0 and at least on iPhone this method still return simply "1"

    ...am I doing something wrong?

  4. Don Thorp 2011-04-15

    Joe, This is an Android Ticket. Please open up a Q&A or HelpDesk item for iPhone. Thanks

  5. marco.schierhorn (at gmail) 2011-04-15

    Seems to work fine for me now (Android)

  6. Joe Maffia 2011-04-15

    Sorry guys... QA is here http://developer.appcelerator.com/question/44101/getting-the-timestamp-of-a-local-file---titaniumfilesystemfilecreatetimestamp"> http://developer.appcelerator.com/question/44101/getting-the-timest... , I'll open a tkt as well

JSON Source