Skip to content

TimeRow Not Using Correct TimeZone #2259

@RSady

Description

@RSady

I'm creating two separate rows...a TimeRow and a ButtonRow. On the button tap I set the TimeRow value to Date(). The date displays but it's always one hour behind my current time zone. I'm in EST, and it's formatting to be displayed in CST. I've checked the actual Date() value and it's correct.

<<< TimeRow(CellTags.time, { row in
    row.title = "Time"
})
        
<<< ButtonRow(CellTags.timeButton, { row in
    row.title = "Set Time to Now + 2 Min"
}).onCellSelection({ [weak self] cell, row in
    guard let self else { return }
    (form.rowBy(tag: CellTags.time) as? TimeRow)?.value = Date()
    (form.rowBy(tag: CellTags.time) as? TimeRow)?.updateCell()
})

When printing the time out, in the .onChange() in the TimeRow, I see this...
Optional(2024-07-19 21:46:07 +0000)

Am I missing something here? I've tried setting the cells default dateFormatters timeZone and Locale and nothing changes.

Simulator Screenshot - iPhone 15 Pro Max - 2024-07-19 at 17 47 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions