I have this format of date time 2021-10-04 05:00:00.000Z. I want in date , hh, mm, ss separately.
How to do this?
CodePudding user response:
Try this
void main() {
var dt = DateTime.parse('2021-10-04 05:00:00.000Z');
print(dt.year);
print(dt.month);
print(dt.hour);
print(dt.minute);
print(dt.second);
}