When I print my DateTime
with myDate.toIso8601String();
it prints
2015-11-15T11:55:32.250
Which doesn't validate with an online validator I tried. The spec says it should be of one of the following formats:
2002-10-02T10:00:00-05:00
2002-10-02T15:00:00Z
2002-10-02T15:00:00.05Z
I could try adding a Z
at the end, but that seems hacky. Is there a way to print a DateTime
in Dart so it complies to one of the following formats?
Z
is for UTC. You get it if you convert your DateTime to an UTC time with
new DateTime().now().toUtc().toIso8601String();
Try it in DartPad
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With