Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Issue 9969098: Set the TZ env to get the UTC-ms since epoch. (Closed)

Created:
8 years, 8 months ago by floitsch
Modified:
8 years, 7 months ago
Reviewers:
cshapiro, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Set the TZ env to get the UTC-ms since epoch. Previously we tried to simply subtract the timezone difference from the local value. Apparently this doesn't work... Fixes issue 1268. Committed: https://code.google.com/p/dart/source/detail?r=7285

Patch Set 1 #

Patch Set 2 : Make timezone functions threadsafe. #

Patch Set 3 : Protect localtime_r too (thread-safe). #

Total comments: 2

Patch Set 4 : Don't change the TZ env variable. #

Patch Set 5 : Remove spurious comment and unify win-code with other platforms. #

Total comments: 8

Patch Set 6 : Addressed comments and rebased. #

Total comments: 15

Patch Set 7 : Address comments. #

Patch Set 8 : rebase #

Patch Set 9 : Remove TODO. #

Patch Set 10 : rebase. #

Patch Set 11 : Switch to timegm. #

Total comments: 2

Patch Set 12 : Address comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -196 lines) Patch
M runtime/lib/date.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +106 lines, -29 lines 0 comments Download
M runtime/vm/os.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +22 lines, -20 lines 0 comments Download
M runtime/vm/os_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +30 lines, -49 lines 0 comments Download
M runtime/vm/os_macos.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +30 lines, -49 lines 0 comments Download
M runtime/vm/os_win.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +32 lines, -49 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
floitsch
Apparently there is no thread-safe function to compute the ms since epoch for a specific ...
8 years, 8 months ago (2012-04-03 15:00:55 UTC) #1
Ivan Posva
Adding a Mutex here does not help you with thread-safety. Adding Carl as he has ...
8 years, 8 months ago (2012-04-03 23:03:52 UTC) #2
floitsch
https://chromiumcodereview.appspot.com/9969098/diff/3001/runtime/vm/os_linux.cc File runtime/vm/os_linux.cc (right): https://chromiumcodereview.appspot.com/9969098/diff/3001/runtime/vm/os_linux.cc#newcode52 runtime/vm/os_linux.cc:52: MutexLocker ml(&timezone_mutex); On 2012/04/03 23:03:52, Ivan Posva wrote: > ...
8 years, 8 months ago (2012-04-04 08:27:43 UTC) #3
floitsch
8 years, 8 months ago (2012-04-04 09:37:17 UTC) #4
floitsch
ping.
8 years, 8 months ago (2012-04-11 11:48:02 UTC) #5
Ivan Posva
Mostly cleanup comments. I hope that Carl can take can properly assess the time API ...
8 years, 8 months ago (2012-04-11 12:01:23 UTC) #6
floitsch
https://chromiumcodereview.appspot.com/9969098/diff/4003/runtime/vm/os_linux.cc File runtime/vm/os_linux.cc (right): https://chromiumcodereview.appspot.com/9969098/diff/4003/runtime/vm/os_linux.cc#newcode17 runtime/vm/os_linux.cc:17: #include "vm/thread.h" On 2012/04/11 12:01:24, Ivan Posva wrote: > ...
8 years, 8 months ago (2012-04-11 12:10:21 UTC) #7
cshapiro
Hi Florian, I am not so sure about the invocations of tzset. It does not ...
8 years, 8 months ago (2012-04-19 23:52:12 UTC) #8
ahe
FYI This passes on Windows: Release_ia32\dart.exe tests\corelib\src\DateTimeTest.dart
8 years, 8 months ago (2012-04-20 13:12:54 UTC) #9
floitsch
PTAL. https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc File runtime/vm/os_macos.cc (left): https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc#oldcode31 runtime/vm/os_macos.cc:31: tzset(); // Make sure the libc knows about ...
8 years, 8 months ago (2012-04-20 16:09:57 UTC) #10
cshapiro
https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc File runtime/vm/os_macos.cc (right): https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc#newcode72 runtime/vm/os_macos.cc:72: *result += UtcOffsetInSeconds(*result); I see no mention of timegm ...
8 years, 8 months ago (2012-04-20 20:47:49 UTC) #11
floitsch
https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc File runtime/vm/os_macos.cc (right): https://chromiumcodereview.appspot.com/9969098/diff/9001/runtime/vm/os_macos.cc#newcode72 runtime/vm/os_macos.cc:72: *result += UtcOffsetInSeconds(*result); On 2012/04/20 20:47:49, cshapiro wrote: > ...
8 years, 8 months ago (2012-04-23 08:37:09 UTC) #12
cshapiro
I looked at the glibc sources and, just for reference, the freebsd libc sources and ...
8 years, 8 months ago (2012-04-27 03:34:02 UTC) #13
floitsch
On 2012/04/27 03:34:02, cshapiro wrote: > I looked at the glibc sources and, just for ...
8 years, 8 months ago (2012-04-27 08:24:43 UTC) #14
cshapiro
On 2012/04/27 08:24:43, floitsch wrote: > http://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzset.c;h=b87578fe48a7688980b176cba482b394508dd037;hb=c0da14cdda1fa552262ce3624156194eef43e973#l608 Got it. Thanks. > My point is, that ...
8 years, 7 months ago (2012-05-01 20:25:53 UTC) #15
floitsch
PTA (hopefully final) L.
8 years, 7 months ago (2012-05-02 10:54:40 UTC) #16
cshapiro
lgtm https://chromiumcodereview.appspot.com/9969098/diff/29007/runtime/vm/os.h File runtime/vm/os.h (right): https://chromiumcodereview.appspot.com/9969098/diff/29007/runtime/vm/os.h#newcode25 runtime/vm/os.h:25: static bool Gmtime(int64_t seconds_since_epoch, tm* tm_result); If you ...
8 years, 7 months ago (2012-05-02 22:04:44 UTC) #17
floitsch
8 years, 7 months ago (2012-05-03 14:46:04 UTC) #18
https://chromiumcodereview.appspot.com/9969098/diff/29007/runtime/vm/os.h
File runtime/vm/os.h (right):

https://chromiumcodereview.appspot.com/9969098/diff/29007/runtime/vm/os.h#new...
runtime/vm/os.h:25: static bool Gmtime(int64_t seconds_since_epoch, tm*
tm_result);
On 2012/05/02 22:04:44, cshapiro wrote:
> If you are going to capitalize the T in MkTime you probably want to do the
same
> here and elsewhere: "GmTime", "LocalTime", "MkGmTime".

Done.

Powered by Google App Engine
This is Rietveld 408576698