fixing timezone issue

This commit is contained in:
otsmr 2025-03-16 15:55:46 +01:00
parent 6d9df0328d
commit c563a09f43

View file

@ -72,7 +72,7 @@ class MessageJson {
messageId: (json['messageId'] as num?)?.toInt(),
content: MessageContent.fromJson(
kind, json['content'] as Map<String, dynamic>),
timestamp: DateTime.parse(json['timestamp'] as String),
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp']),
);
}
@ -80,7 +80,7 @@ class MessageJson {
'kind': kind.name,
'content': content?.toJson(),
'messageId': messageId,
'timestamp': timestamp.toIso8601String(),
'timestamp': timestamp.toUtc().millisecondsSinceEpoch,
};
}