Skip to content

Commit fb2a40a

Browse files
oschwaldclaude
andcommitted
fix: Use DST-aware timezone offset calculation
Change timezoneOffset from rawOffset to getOffset(currentTime) to properly account for Daylight Saving Time. The rawOffset only returns the base UTC offset without DST adjustment, which gives incorrect results during DST periods. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 51cc67e commit fb2a40a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

device-sdk/src/main/java/com/maxmind/device/collector/DeviceDataCollector.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ internal class DeviceDataCollector(
140140
telephony = telephonyCollector.collect(),
141141
fonts = fontCollector.collect(),
142142
locale = collectSafe(LOCALE_INFO_FALLBACK) { collectLocaleInfo() },
143-
// Timezone offset in minutes
144-
timezoneOffset = TimeZone.getDefault().rawOffset / 60000,
143+
// Timezone offset in minutes (uses getOffset to account for DST)
144+
timezoneOffset = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 60000,
145145
deviceTime = System.currentTimeMillis(),
146146
webViewUserAgent = webViewCollector.collectUserAgent(),
147147
)

0 commit comments

Comments
 (0)