mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Remove dead _localTimeZoneAdjustmentInSeconds.
Dead since 6af4987dc6
.
TEST=ci
Change-Id: Ib92d2334dcc4c98e203628b4a8d244e6277b6b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251841
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
parent
710c0b3695
commit
9b6bda05ec
|
@ -36,11 +36,6 @@ DEFINE_NATIVE_ENTRY(DateTime_timeZoneOffsetInSeconds, 0, 1) {
|
|||
return Integer::New(offset);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(DateTime_localTimeZoneAdjustmentInSeconds, 0, 0) {
|
||||
int adjustment = OS::GetLocalTimeZoneAdjustmentInSeconds();
|
||||
return Integer::New(adjustment);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(DateTime_currentTimeMicros, 0, 0) {
|
||||
return Integer::New(OS::GetCurrentTimeMicros());
|
||||
}
|
||||
|
|
|
@ -145,7 +145,6 @@ namespace dart {
|
|||
V(DateTime_currentTimeMicros, 0) \
|
||||
V(DateTime_timeZoneName, 1) \
|
||||
V(DateTime_timeZoneOffsetInSeconds, 1) \
|
||||
V(DateTime_localTimeZoneAdjustmentInSeconds, 0) \
|
||||
V(AssertionError_throwNew, 3) \
|
||||
V(AssertionError_throwNewSource, 4) \
|
||||
V(Error_throwWithStackTrace, 2) \
|
||||
|
|
|
@ -34,11 +34,6 @@ class OS {
|
|||
// For example 3600 for CET, and 7200 for CEST.
|
||||
static int GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch);
|
||||
|
||||
// Returns the difference in seconds between local time and UTC when no
|
||||
// daylight saving is active.
|
||||
// For example 3600 in CET and CEST.
|
||||
static int GetLocalTimeZoneAdjustmentInSeconds();
|
||||
|
||||
// Returns the current time in milliseconds measured
|
||||
// from midnight January 1, 1970 UTC.
|
||||
static int64_t GetCurrentTimeMillis();
|
||||
|
|
|
@ -121,14 +121,6 @@ int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
|
|||
return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0;
|
||||
}
|
||||
|
||||
int OS::GetLocalTimeZoneAdjustmentInSeconds() {
|
||||
// TODO(floitsch): avoid excessive calls to tzset?
|
||||
tzset();
|
||||
// Even if the offset was 24 hours it would still easily fit into 32 bits.
|
||||
// Note that Unix and Dart disagree on the sign.
|
||||
return static_cast<int>(-timezone);
|
||||
}
|
||||
|
||||
int64_t OS::GetCurrentTimeMillis() {
|
||||
return GetCurrentTimeMicros() / 1000;
|
||||
}
|
||||
|
|
|
@ -415,14 +415,6 @@ int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
|
|||
return status == ZX_OK ? local_offset + dst_offset : 0;
|
||||
}
|
||||
|
||||
int OS::GetLocalTimeZoneAdjustmentInSeconds() {
|
||||
int32_t local_offset, dst_offset;
|
||||
int64_t now_seconds = GetCurrentTimeNanos() / ZX_SEC(1);
|
||||
zx_status_t status =
|
||||
GetLocalAndDstOffsetInSeconds(now_seconds, &local_offset, &dst_offset);
|
||||
return status == ZX_OK ? local_offset : 0;
|
||||
}
|
||||
|
||||
int64_t OS::GetCurrentTimeMillis() {
|
||||
return GetCurrentTimeNanos() / ZX_MSEC(1);
|
||||
}
|
||||
|
|
|
@ -440,14 +440,6 @@ int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
|
|||
return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0;
|
||||
}
|
||||
|
||||
int OS::GetLocalTimeZoneAdjustmentInSeconds() {
|
||||
// TODO(floitsch): avoid excessive calls to tzset?
|
||||
tzset();
|
||||
// Even if the offset was 24 hours it would still easily fit into 32 bits.
|
||||
// Note that Unix and Dart disagree on the sign.
|
||||
return static_cast<int>(-timezone);
|
||||
}
|
||||
|
||||
int64_t OS::GetCurrentTimeMillis() {
|
||||
return GetCurrentTimeMicros() / 1000;
|
||||
}
|
||||
|
|
|
@ -60,14 +60,6 @@ int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
|
|||
return succeeded ? static_cast<int>(decomposed.tm_gmtoff) : 0;
|
||||
}
|
||||
|
||||
int OS::GetLocalTimeZoneAdjustmentInSeconds() {
|
||||
// TODO(floitsch): avoid excessive calls to tzset?
|
||||
tzset();
|
||||
// Even if the offset was 24 hours it would still easily fit into 32 bits.
|
||||
// Note that Unix and Dart disagree on the sign.
|
||||
return static_cast<int>(-timezone);
|
||||
}
|
||||
|
||||
int64_t OS::GetCurrentTimeMillis() {
|
||||
return GetCurrentTimeMicros() / 1000;
|
||||
}
|
||||
|
|
|
@ -106,13 +106,6 @@ int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
|
|||
}
|
||||
}
|
||||
|
||||
int OS::GetLocalTimeZoneAdjustmentInSeconds() {
|
||||
// TODO(floitsch): avoid excessive calls to _tzset?
|
||||
_tzset();
|
||||
// Dart and Windows disagree on the sign of the bias.
|
||||
return static_cast<int>(-_timezone);
|
||||
}
|
||||
|
||||
int64_t OS::GetCurrentTimeMillis() {
|
||||
return GetCurrentTimeMicros() / 1000;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,6 @@ class DateTime {
|
|||
external static int _timeZoneOffsetInSecondsForClampedSeconds(
|
||||
int secondsSinceEpoch);
|
||||
|
||||
// Daylight-savings independent adjustment for the local time zone.
|
||||
@pragma("vm:external-name", "DateTime_localTimeZoneAdjustmentInSeconds")
|
||||
external static int _localTimeZoneAdjustmentInSeconds();
|
||||
|
||||
static const _MICROSECOND_INDEX = 0;
|
||||
static const _MILLISECOND_INDEX = 1;
|
||||
static const _SECOND_INDEX = 2;
|
||||
|
|
|
@ -28,10 +28,6 @@ class DateTime {
|
|||
external static int _timeZoneOffsetInSecondsForClampedSeconds(
|
||||
int secondsSinceEpoch);
|
||||
|
||||
// Daylight-savings independent adjustment for the local time zone.
|
||||
@pragma("vm:external-name", "DateTime_localTimeZoneAdjustmentInSeconds")
|
||||
external static int _localTimeZoneAdjustmentInSeconds();
|
||||
|
||||
static const _MICROSECOND_INDEX = 0;
|
||||
static const _MILLISECOND_INDEX = 1;
|
||||
static const _SECOND_INDEX = 2;
|
||||
|
|
Loading…
Reference in a new issue