You didn’t set the timezone of the output date, so it’s defaulting to your systems’ timezone rather than UTC (which is what you were expecting).
More Related Contents:
- DateFormatter doesn’t return date for “HH:mm:ss”
- How do I make an HTTP request in Swift?
- Save images in NSUserDefaults?
- Get User’s Current Location / Coordinates
- Detect current device with UI_USER_INTERFACE_IDIOM() in Swift
- How do you create a Swift Date object?
- How do I hide the status bar in a Swift iOS app?
- Swift days between two NSDates
- How to increase the height of navigation bar in Xcode?
- How to crop UIImage on oval shape or circle shape?
- How to add minutes to current time in swift
- Screenshot in Swift iOS?
- how to implement lazy loading of images in table view using swift
- Swift default AlertViewController breaking constraints
- Static Library and Swift
- What is export * in module.modulemap file inside each framework?
- When to use takeUnretainedValue() or takeRetainedValue() to retrieve Unmanaged Objects in Swift?
- How to maintain presenting view controller’s orientation when dismissing modal view controller?
- Simple and clean way to convert JSON string to Object in Swift
- ‘Receiver () has no segue with identifier ‘addSegue’
- Swift: How to open a new app when UIButton is tapped
- Change button background color using swift language
- SwiftUI: Set Status Bar Color For a Specific View
- Open PDF file using swift
- Converting UTC date format to local nsdate
- Detect if the application in background or foreground in swift
- Disable zoom in WKWebView?
- How to get the front camera in Swift?
- How to get memory usage in Swift [duplicate]
- Convert date string swift