{ "id": "62717", "key": "TIMOB-2085", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:02.000+0000", "created": "2011-04-15T03:09:59.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "createtimestamp", "defect", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:03.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

spun off of #1642

\n

1.run the script below on an an iOS device running 3.2.2 or\nolder.

\n

var filename = 'iphone_coming_soon.png'; var timeStampOfFile =\n''; var file =\nTitanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename);\nif ( file.exists() ) { Ti.API.info('IF IS TRUE'); timeStampOfFile =\nfile.createTimestamp(); }

\n

Ti.API.info('The value of timeStampOfFile is: ' +\ntimeStampOfFile);

\n

results: [INFO] newfile.txt created: Wed Dec 31 1969\n16:00:00 GMT-0800 (PST)

\n

expected: return actual date,

\n

notes: Setting to medium

{html}", "attachment": [], "flagged": false, "summary": "file.createTimeStamp returns unexpected date on iOS 3.2.2 and earlier", "creator": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "127444", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Could be an Apple bug. Looking into it.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:00.000+0000", "updated": "2011-04-15T03:10:00.000+0000" }, { "id": "127445", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is indeed an Apple bug. There is a workaround but it WILL\nreturn different file creation dates on 3.x and 4.x (we spoof the\ncreation date with the modification date on 3.x - they're similar,\nbut may differ by a few seconds).

\n

Will patch the fix into 1_4_X when approved.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:00.000+0000", "updated": "2011-04-15T03:10:00.000+0000" }, { "id": "127446", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [9977c7719107da0d1281fd50b487667c73d194c9])\n[#2085] Added test in KS 'Filesystems'. \nhttp://github.com/appcelerator/titanium_mobile/commit/9977c7719107d...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:00.000+0000", "updated": "2011-04-15T03:10:00.000+0000" }, { "id": "127447", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [c6164c4d92c302ff3582ceb3bb76727cf7aa57e0])\n[#2085 state:fixed-in-qa] Spoof file modification\ndate as creation date when creation date is not available (3.x\nApple bug for initially installed files) \nhttp://github.com/appcelerator/titanium_mobile/commit/c6164c4d92c30...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:00.000+0000", "updated": "2011-04-15T03:10:00.000+0000" }, { "id": "127448", "author": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This also appears to be an issue with\nfile.modificationTimestamp() ... I assume you noticed, but it\nwasn't listed.

\n

Tim

\n

See below for example output.
\nTi.API.debug('Images.getImageUrl image details Create:Modify = ' +\nString(new Date(imageFile.createTimestamp())) +':'+String(new\nDate(imageFile.modificationTimestamp())));

\n

Renders
\n[DEBUG] Images.getImageUrl image details\nCreate:Modify = Wed Dec 31 1969 19:00:00 GMT-0500 (EST):Wed Dec 31\n1969 19:00:00 GMT-0500 (EST)

{html}", "updateAuthor": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:00.000+0000", "updated": "2011-04-15T03:10:00.000+0000" }, { "id": "127449", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This does not occur under 3.1.x.

\n
\n[INFO] created = Sun Oct 17 2010 22:58:21 GMT-0700 (PDT)\n[INFO] modified = Sun Oct 17 2010 22:58:21 GMT-0700 (PDT)\n
\n

Thom, can you confirm whether or not the modification bug\nappears in 3.2 ONLY?

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:01.000+0000", "updated": "2011-04-15T03:10:01.000+0000" }, { "id": "127450", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I am unable to repro the incorrect behavior on a 3.2.2 device -\nusing 1.5.0.62c1cae the test works as expected.

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:10:01.000+0000", "updated": "2011-04-15T03:10:01.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }