Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5890] Android: Passing the wrong time to analytics. Need to decide on local time + offest or UTC time with no offset

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-12-05T15:20:23.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-49, Release 1.8.0.1
ComponentsAndroid
Labelsn/a
ReporterNatalie Huynh
AssigneeAllen Yeung
Created2011-10-27T14:53:32.000+0000
Updated2014-06-19T12:42:39.000+0000

Description

Steps To Reproduce: 1. Run test case 1000 from http://wiki.appcelerator.org/display/tp/Analytics+Test+Plan Actual Result: {"id":"a91452a9-dbe3-4725-abbf-fa0acc0a5fa7:62aa69827255df19","sid":"fc6d2a62-5bcd-4b00-b158-3f036d9f6fb7","ts":"2011-10-27T21:22:20.767-0800","event":"ti.enroll" Expected Result: To either display local time with offset: 2011-10-27 15:37:55-07:00 Or UTC time with no offset: 2011-10-27T22:23:44.162+0000 Note: If we decide on local time with offset, we need to put a parity bug for iOS to fix, as they are currently using UTC time with no offset

Comments

  1. Chung Liu 2011-10-28

    The correct behavior is explained in RFC-3339. In Linux you can use: % date --rfc-3339=seconds 2011-10-28 11:03:04-07:00 Note that 11:03:04-07:00 is equivalent to 18:03:04-00:00 and 14:03:04-04:00. Any of these options are fine for the timestamp. iPhone appears to always send the UTC time with offset 00:00, which is one of the correct behaviors. Android appears to send UTC time with an offset that is *not* always 00:00. It needs to either send UTC with offset 00:00, or send a local time with the offset of the local time zone. I'm attaching a few seconds of production analytics logs from Android devices. Look at "ts:" below to see the variation in timestamps. Note that these are consecutive events received within the a few seconds. 2011-10-28T18:20:45.287-0500 // incorrect. Should be 18:20:45.287-0000 or 13:20:45.287-0500 2011-10-28T18:20:19.248+0000 // correct 2011-10-28T18:20:19.248+0000 // correct 2011-10-28T18:20:33.552-0500 // incorrect ... 2011-10-28T18:25:03.634+0100 // incorrect ... 2011-10-28T18:21:02.928+0000 // correct {"id":"d88b297d-46b1-4c8e-832b-ccdfd5798f1b:514302aad2a8a0ea","sid":"c5e576c9-535d-4c61-bbdb-3208f5281324","ts":"2011-10-28T18:20:45.287-0500","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv7 Processor rev 2 (v7l)","model":"ADR6300","mac_addr":"514302aad2a8a0ea","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.cdta.busplus","app_name":"BusPlus"}, "seq":1,"mid":"514302aad2a8a0ea","ver":"2","type":"ti.enroll","aguid":"8ebae32a-fe5b-410a-979c-f9cd18cd4188"} {"id":"c90c6096-f112-4535-9dc1-ab62cc6013e1:c42db4e0d5874040","sid":"80ae1d7d-7f8a-4c25-8c45-1899c6708739","ts":"2011-10-28T18:20:19.248+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"HTC Wildfire S","mac_addr":"D4:20:6D:D8:C7:C4","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"de.kicktipp.mbookmark ","app_name":"Kicktipp"},"seq":1,"mid":"c42db4e0d5874040","ver":"2","type":"ti.enroll","aguid":"12c2a067-b745-49c1-be54-b85440833449"} {"id":"c90c6096-f112-4535-9dc1-ab62cc6013e1:c42db4e0d5874040","sid":"80ae1d7d-7f8a-4c25-8c45-1899c6708739","ts":"2011-10-28T18:20:19.248+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"HTC Wildfire S","mac_addr":"D4:20:6D:D8:C7:C4","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"de.kicktipp.mbookmark ","app_name":"Kicktipp"},"seq":1,"mid":"c42db4e0d5874040","ver":"2","type":"ti.enroll","aguid":"12c2a067-b745-49c1-be54-b85440833449"} {"id":"bf45b7ae-1ceb-4928-8aef-af58e9e1da9c:20014733dbf08961","sid":"6c5fb569-a1fb-42ab-9544-8e7c40721dc3","ts":"2011-10-28T18:20:33.552-0500","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"GT-I5500","mac_addr":"BC:47:60:1E:3B:D9","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"es.simtec.imcb","app_name": "imcb"},"seq":1,"mid":"20014733dbf08961","ver":"2","type":"ti.enroll","aguid":"980fb5b9-6444-4b88-a042-a574baa8e769"} {"id":"bf45b7ae-1ceb-4928-8aef-af58e9e1da9c:20014733dbf08961","sid":"6c5fb569-a1fb-42ab-9544-8e7c40721dc3","ts":"2011-10-28T18:20:33.552-0500","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"GT-I5500","mac_addr":"BC:47:60:1E:3B:D9","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"es.simtec.imcb","app_name": "imcb"},"seq":1,"mid":"20014733dbf08961","ver":"2","type":"ti.enroll","aguid":"980fb5b9-6444-4b88-a042-a574baa8e769"} {"id":"a33abcba-0016-4630-aacc-103880774b10:eb27d9f4977ee0b6","sid":"12aad8e1-2806-444c-a6fd-131c6d9abf4b","ts":"2011-10-28T18:20:14.806+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv7 Processor rev 2 (v7l)","model":"HTC HD2","mac_addr":"00:23:76:24:84:1F","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"tw.com.nexttv.rtnews","app_name":"NextT VRTNews"},"seq":1,"mid":"eb27d9f4977ee0b6","ver":"2","type":"ti.enroll","aguid":"df9a65b1-1add-4fb3-83f3-6179c52f7fac"} {"id":"73255c28-92ca-46a5-aced-c53dd84464de:e6d834e4-2959-45f3-b915-db7168d50fdd","sid":"36771322-bf3d-4282-9925-332f27c72b0e","ts":"2011-10-28T18:25:03.634+0100","event":"ti.enroll","data":{"platform ":"android","osarch":"ARMv7 Processor rev 2 (v7l)","model":"A28","mac_addr":"00:16:dc:61:2c:84","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.dedrisproject.televideolite","app_nam e":"Televideo Ita Lite"},"seq":1,"mid":"e6d834e4-2959-45f3-b915-db7168d50fdd","ver":"2","type":"ti.enroll","aguid":"99282ad2c39c456d916afd521758f8a1"} {"id":"73255c28-92ca-46a5-aced-c53dd84464de:e6d834e4-2959-45f3-b915-db7168d50fdd","sid":"36771322-bf3d-4282-9925-332f27c72b0e","ts":"2011-10-28T18:25:03.634+0100","event":"ti.enroll","data":{"platform ":"android","osarch":"ARMv7 Processor rev 2 (v7l)","model":"A28","mac_addr":"00:16:dc:61:2c:84","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.dedrisproject.televideolite","app_nam e":"Televideo Ita Lite"},"seq":1,"mid":"e6d834e4-2959-45f3-b915-db7168d50fdd","ver":"2","type":"ti.enroll","aguid":"99282ad2c39c456d916afd521758f8a1"} {"id":"dc608b8b-4332-474a-868a-b8d68ba244e2:2001450333ae720e","sid":"bf249b82-bd36-4bca-b144-7c749e40dc04","ts":"2011-10-28T18:20:51.103-0500","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"Garminfone","mac_addr":"2001450333ae720e","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.totaldevel.android.tod opoemas.ads","app_name":"Todo Poemas"},"seq":1,"mid":"2001450333ae720e","ver":"2","type":"ti.enroll","aguid":"a74fcc66-cbff-4523-a13a-b0ab7c47bb9f"} {"id":"dc608b8b-4332-474a-868a-b8d68ba244e2:2001450333ae720e","sid":"bf249b82-bd36-4bca-b144-7c749e40dc04","ts":"2011-10-28T18:20:51.103-0500","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"Garminfone","mac_addr":"2001450333ae720e","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.totaldevel.android.tod opoemas.ads","app_name":"Todo Poemas"},"seq":1,"mid":"2001450333ae720e","ver":"2","type":"ti.enroll","aguid":"a74fcc66-cbff-4523-a13a-b0ab7c47bb9f"} {"id":"1f42239e-0052-403f-b67b-4ca867837e73:d44d469afb0b06a9","sid":"abec9bd5-4813-4278-bba7-ae45eabfded7","ts":"2011-10-28T18:21:16.012+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv7 Processor rev 2 (v7l)","model":"DROIDX","mac_addr":"40:fc:89:1c:6c:cc","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.apsquared.tvfoodmaps","app_name":"TV FoodMaps"},"seq":1,"mid":"d44d469afb0b06a9","ver":"2","type":"ti.enroll","aguid":"0c0b0b37-81d4-4832-a991-9ba9723406f3"} {"id":"6d532d52-399c-4382-96b9-192db633a1e2:e275bc0fc320585","sid":"6a3eb943-1c9c-4670-b2f8-e01aca8d33bb","ts":"2011-10-28T18:21:04.100+0000","event":"ti.enroll","data":{"platform":"android","osarch": "ARMv7 Processor rev 1 (v7l)","model":"Desire HD","mac_addr":"64:A7:69:99:DD:22","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.scoutmob.ile","app_name":"Scoutmob "},"seq":1,"mid":"e275bc0fc320585","ver":"2","type":"ti.enroll","aguid":"e8e993e2-96d7-42f5-ac41-fbabe833c3f0"} {"id":"c43c6660-dfd4-4145-a036-d4ba2af11bd5:597a26c6a33da497","sid":"2f2ee4e9-cf23-440e-adaa-1de3e9f268f1","ts":"2011-10-28T18:21:05.440+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"GT-S5830","mac_addr":"D0:C1:B1:1D:A0:84","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.directgov.jcp","app_nam e":"jobcentreplus"},"seq":1,"mid":"597a26c6a33da497","ver":"2","type":"ti.enroll","aguid":"e7d333fb-8f15-446d-880f-e28f69bc83d7"} {"id":"c43c6660-dfd4-4145-a036-d4ba2af11bd5:597a26c6a33da497","sid":"2f2ee4e9-cf23-440e-adaa-1de3e9f268f1","ts":"2011-10-28T18:21:05.440+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv6-compatible processor rev 5 (v6l)","model":"GT-S5830","mac_addr":"D0:C1:B1:1D:A0:84","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.directgov.jcp","app_nam e":"jobcentreplus"},"seq":1,"mid":"597a26c6a33da497","ver":"2","type":"ti.enroll","aguid":"e7d333fb-8f15-446d-880f-e28f69bc83d7"} {"id":"971b1dc1-947c-47a7-9485-081041b58eb2:5f0dc25776fb3f9f","sid":"18092d25-2e50-4af8-9428-d7853d976eeb","ts":"2011-10-28T18:21:02.928+0000","event":"ti.enroll","data":{"platform":"android","osarch" :"ARMv7 Processor rev 1 (v7l)","model":"HTC Glacier","mac_addr":"5f0dc25776fb3f9f","previous_mid":"","oscpu":1,"ostype":"32bit","deploytype":"production","app_id":"com.scoutmob.ile","app_name":"Scoutm ob"},"seq":1,"mid":"5f0dc25776fb3f9f","ver":"2","type":"ti.enroll","aguid":"e8e993e2-96d7-42f5-ac41-fbabe833c3f0"}
  2. Allen Yeung 2011-12-03

    PR ready here: https://github.com/appcelerator/titanium_mobile/pull/821 The timestamp should be UTC time with no offset.
  3. Michael Pettiford 2012-01-10

    Closing issue Tested with Ti Studio 1.0.8.201201091758 Ti Mob SDK 1.8.0.1 OSX Lion iPhone 4S, Droid 3 both v8 and rhino Expected behavior of timestamps on iOS and Android matching is shown

JSON Source