Skip to content

Setting incorrect value for timestamp causes date to be set as UTC and to return as a string #2571

Open
@coolaj86

Description

@coolaj86

I had accidentally set { "timestamp": "America/Denver" } and I would get back MySQL strings instead of JavaScript Dates.

I would have expected

  • an exception - bad values should throw errors
  • or the default to be used - bad values could also be ignored, and the default used

What I got was

  • inserted values would be transposed - as if the UTC hours value was used, but set as if it were local
  • selected values would return as strings - rather than returning as date objects

The solution was to use { "timestamp": "local" }.

As far as I can tell { "timestamp": "UTC" } and { "timestamp": "-06:00" } had no effect.

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