Skip to content

Commit d7acaca

Browse files
#430: Add comment to currentSystemDefaultZone
1 parent d6aa923 commit d7acaca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/linux/src/internal/TimeZoneNative.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ private fun getTimezoneFromEtcTimezone(): String? {
4343
}
4444

4545
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).
4649
val zonePath = currentSystemTimeZonePath ?: return "Z" to null
4750

4851
zonePath.splitTimeZonePath()?.second?.toString()?.let { zoneId ->

0 commit comments

Comments
 (0)