Home > Software design >  Convert to datetime format with hours, minutes and seconds separate
Convert to datetime format with hours, minutes and seconds separate

Time:11-17

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);
}

If you need another type of manipulations use image

  • Related