We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6aa923 commit d7acacaCopy full SHA for d7acaca
core/linux/src/internal/TimeZoneNative.kt
@@ -43,6 +43,9 @@ private fun getTimezoneFromEtcTimezone(): String? {
43
}
44
45
internal actual fun currentSystemDefaultZone(): Pair<String, TimeZone?> {
46
+ // According to https://www.man7.org/linux/man-pages/man5/localtime.5.html, UTC is used when /etc/localtime is missing.
47
+ // If /etc/localtime exists but isn't a symlink, we check if it's a copy of a timezone file by examining /etc/timezone
48
+ // (which is a Debian-specific approach used in older distributions).
49
val zonePath = currentSystemTimeZonePath ?: return "Z" to null
50
51
zonePath.splitTimeZonePath()?.second?.toString()?.let { zoneId ->
0 commit comments