Skip to content

TimeZone rounds second-offset unlike DarwinFoundation. #5079

Closed as not planned
@YOCKOW

Description

@YOCKOW

The code below says all.

import Foundation

print(TimeZone(secondsFromGMT: 15)!.secondsFromGMT())
// Prints "15" with DarwinFoundation
// Prints  "0" with swift-corelibs-foundation

print(TimeZone(secondsFromGMT: 3690)!.secondsFromGMT())
// Prints "3690" with DarwinFoundation
// Prints "3720" with swift-corelibs-foundation

Environment
Swift version 6.0-dev (LLVM 57177aa1b91540b, Swift 8be62863326595c)
Target: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions