Flutter parse GMT

658

You can use the HttpDate class to parse this.

Example:

DateTime parsedDate = HttpDate.parse("Thu, 10 Oct 2019 02:05:09 GMT");
Share:
658
Admin
Author by

Admin

Updated on November 29, 2022

Comments

  • Admin
    Admin 4 days

    Hello,I have a question! I want to parse Time, GMT to Milliseconds。 for example:Thu, 10 Oct 2019 02:05:09 GMT. I try DateTime.parse("Thu, 10 Oct 2019 02:05:09 GMT") i get this error

    Exception caught by widgets library The following FormatException was thrown building GroupPage(dirty, state: _GroupPage#cb39c): invalid date format Thu, 10 oct 2019 02:05:09 GMT