unable to convert string date in Format yyyyMMddHHmmss to DateTime dart

后端 未结 6 924
不知归路
不知归路 2021-02-07 01:49

i have a string containing date in format yyyyMMddHHmmss (e.g.) (20180626170555) and i am using following code to convert it into date time

dateTimeFromString(         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 02:09

    From the docs, you need Single M to month in year :

    dateTimeFromString(json['dateTime'], "yMdHms")
    

提交回复
热议问题