London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
11.3 C
New York
Friday, November 8, 2024

ios – How am i able to Including hours to a specific hour in SwiftUI to rework native hours in to Zulu hours


Do that method utilizing a DateFormatter, comparable to:

struct ContentView: View {
    @State non-public var startTime: Date = .now
    
    var formatter: DateFormatter {
        let frmt = DateFormatter()
        frmt.dateFormat = "MMMM dd, yyyy 'at' hh:mm"
        frmt.locale = Locale(identifier: "da")
        frmt.timeZone = TimeZone(abbreviation: "UTC") // zulu (UTC) time
        return frmt
    }
    
    var physique: some View {
        VStack {
            DatePicker("_", choice: $startTime, displayedComponents: .hourAndMinute)
                .labelsHidden()
                .datePickerStyle(.wheel)
            Textual content(formatter.string(from: startTime)) // zulu (UTC) time
        }
        .atmosphere(.locale, .init(identifier: "da"))
    }
}

Or this:

struct ContentView: View {
    @State non-public var startTime: Date = .now
    @State non-public var zuluTime = ""
    
    var formatter: DateFormatter {
        let frmt = DateFormatter()
        frmt.dateFormat = "hh:mm"
        frmt.locale = Locale(identifier: "da")
        frmt.timeZone = TimeZone(abbreviation: "UTC") // zulu (UTC) time
        return frmt
    }
    
    var physique: some View {
        VStack {
            DatePicker("_", choice: $startTime, displayedComponents: .hourAndMinute)
                .labelsHidden()
                .datePickerStyle(.wheel)
            Textual content(zuluTime) // zulu (UTC) time
            Textual content(startTime, fashion: .time) // native time
        }
        .atmosphere(.locale, .init(identifier: "da"))
        .onChange(of: startTime) {
            zuluTime = formatter.string(from: startTime)
        }
        .onAppear {
            zuluTime = formatter.string(from: startTime)
        }
    }
}

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com