Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

UTC time displayed instead of local time zone

Open gklyber opened this issue 12 years ago • 11 comments

With the new display of message sent time, my Motorola Droid Pro with Gingerbread 2.3.4 shows UTC time the message was sent. Message receive time in message details still shows the local time. The notification of the message also shows the correct local time.

gklyber avatar Apr 13 '14 21:04 gklyber

@gklyber have you used the "message details" view ? Long-tap onto outgoing- or incoming message opens the detailed view.

Wikinaut avatar Apr 13 '14 21:04 Wikinaut

Yes. "Message details" refers to the long-tap detailed view. It shows UTC for sent time and local time for received time on received SMS messages.

gklyber avatar Apr 13 '14 21:04 gklyber

Tried sending messages from a device with a different time zone, same time zone, and checking the timestamps. They all appeared in local time to me, but I wasn't on GB. SMS on my GB emulator also appeared normal. Seems strange that this would be a specific issue with push messages on GB, but I've heard stranger things. Somebody else with a GB phone and push messages want to verify?

mcginty avatar Apr 14 '14 22:04 mcginty

I forgot to clarify that I only use SMS. Would a log file help? I will try to grab one.

gklyber avatar Apr 15 '14 02:04 gklyber

Adding findings that seem similar to me. On Samsung Galaxy S4 Android 4.3 verizon stock rom

Sending texts to contacts makes my time correct but the other person's texts timestamps behind by one hour. In mst7mdt. Daylight savings issue? Could it be the dates for daylight savings time change are off? This was sms. Didn't check push.

Also, the other sms side was in my same timezone...example Me: hi 1:00pm Them: what's shaking? 12:02pm Me: blah blah 1:05pm Them: don't waste my time, fool. 12:07pm

jeremymasters avatar Apr 15 '14 16:04 jeremymasters

This is why we showed received time by default before caving to demand. We have no control over whatever sent time comes in through an SMS, and it's often incorrect.

moxie0 avatar Apr 15 '14 18:04 moxie0

To clarify the original post in this issue - is it that you're getting incorrect times even if they were localized or that those times are represented in UTC when you expect it to be localized? I assumed the latter.

If SMS sent times are that sporadic, maybe we should only use this for push?

mcginty avatar Apr 15 '14 18:04 mcginty

At the risk of option bloat, could this be a selectable option? It seems like we could end up having two main sets of options and this would fall in the "enable advanced options" section where one could then choose which was displayed and the more accurate one would be the default. Not to belabor the discussion and re-beat the dead horse but in my unsolicited opinion accuracy trumps the alternative. Sounds like I'm agreeing with @moxie0 on this to a degree.

jeremymasters avatar Apr 15 '14 19:04 jeremymasters

@mcginty We get Unix time (https://developer.android.com/reference/android/telephony/SmsMessage.html#getTimestampMillis() ), but it's often not correct.

I'm probably alright with making SMS received time and Push sent time (although people will assume push 'takes longer' than SMS), but it's a little confusing. I don't think I'd support an option that toggles the behavior.

moxie0 avatar Apr 15 '14 19:04 moxie0

I also have the Moto X w/ Android 4.2.2, and all received SMS are reporting the same sent time as @lookgravity -- unix time 0, or thereabouts.

Looking quickly, it seems like there's two main points to think about patching:

https://github.com/WhisperSystems/TextSecure/blob/master/src/org/thoughtcrime/securesms/ConversationItem.java#L281 -- using getDateSent, which was a recent change and can likely be kept.

https://github.com/WhisperSystems/TextSecure/blob/master/src/org/thoughtcrime/securesms/database/model/DisplayRecord.java#L67 -- patch getDateSent such that it runs a conditional, something like:

if (Math.abs(dateReceived - dateSent) > threshold) return dateReceived;
return dateSent;

for threshold representing something on the order of 30 minutes, or whatever is the minimum timezone difference.

rlaskey avatar Apr 25 '14 03:04 rlaskey

Since there's little we can do to pressure carriers into not screwing up their SMS timestamps, https://github.com/WhisperSystems/TextSecure/commit/d51adab76b1d73dddefe77674cf753203a1955e2 hits a happy medium. Closing this, thanks.

mcginty avatar Jun 16 '14 23:06 mcginty