Stop DateTime Auto-Formatting to User's Timezone?

Troubleshooting

Hi there!

I'm running into an issue where a UNIX timestamp (1554076800000) from my API is meant to represent a the exact date it is, in this example, April 1, 2019. I’m converting it using a custom function like:

DateTime.fromMillisecondsSinceEpoch(ms, isUtc: true)

However, in FlutterFlow’s debug panel, the resulting DateTime appears as “March 31, 2019, 5:00 PM” (I’m in Pacific Time), and formatDate() functions also reflect this local conversion.

I just want the date to reliably represent the correct month in UTC no matter where the user is. Is FlutterFlow automatically interpreting or storing all DateTime values in the user’s local time zone? And if so, is there a reliable way to store UTC without these shifts?

TLDR: I need it to NOT auto-format based on the user's local timezone. Why is it doing this?

What have you tried so far?
  • Confirmed that the UNIX timestamps are correct by checking them with external converters (they match UTC midnight as expected).

  • Created a custom function that uses DateTime.fromMillisecondsSinceEpoch(..., isUtc: true) to enforce UTC.

  • Verified that DateTime values still display offset in FlutterFlow’s debug panel.

Did you check FlutterFlow's Documentation for this topic?
No
1
1 reply