Skip to content

UTC DateTime are getting converted to Local DateTime #308

Open
@raphire08

Description

@raphire08

Save any variable with @Property(type: PropertyType.date) annotation with value as DateTime.now().toUtc()
Read the same variable DateTime comes back in local time zone and UTC flag is false

  • ObjectBox version: [e.g. 0.14.0]
    objectbox: ^1.2.0
    objectbox_flutter_libs: ^1.2.0

  • Flutter/Dart SDK: [e.g. 2.0.0, or the output of dart --version or flutter --version]
    Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision f4abaa0735 (9 weeks ago) • 2021-07-01 12:46:11 -0700
    Engine • revision 241c87ad80
    Tools • Dart 2.13.4

  • Null-safety enabled: [yes | no]
    yes

  • Reproducibility: [e.g. occurred once only | occasionally without visible pattern | always]
    always

  • Device/Emulator: [e.g. Galaxy S20]
    iPhone 8+ Simulator

Additionally, you can choose to provide more details, e.g. the output of:

Steps to reproduce

  1. Put any entity class having variable as date in UTC
  2. Read the same entity class
  3. DateTime comes back in local timezone

Expected behavior

Date time should be in UTC only

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionHow to do something/general question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions