I’m trying to parse a DateTime from a response of a JSON object
print(DateTime.parse("2022-07-05T15:11:44+09:00"));
Getting output:
2022-07-05 06:11:44.000Z
Desired output:
2022-07-05 03:11:44.000Z
How I will get the desired output?
>Solution :
Try calling .toLocal():
void main() {
print(DateTime.parse('2022-07-05 06:11:44.000Z').toLocal());
}