I know this is duplication but since I haven't been able to find correct way so please don't mark this as duplicate.
I would like to set date type correctly to Firestore
in flutter. I tried DateTime.now()
but when I retrieve it error says
Unsupported value: FIRTimestamp: seconds=1533950401 nanoseconds=81000000> of type FIRTimestamp
and app will crash. Also I tried millisecondsSinceEpoch
, microsecondsSinceEpoch
, toUtc
but Firestore recognize those as number not timestamp. I used intl
package and formatted like yyyy-MM-dd hh:mm
but it was recognized as String.
Does anyone know how to set timestamp correctly?