Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

how to convert string into date format

print(DateTime.parse('2020-01-02')); // 2020-01-02 00:00:00.000
  print(DateTime.parse('20200102')); // 2020-01-02 00:00:00.000
  print(DateTime.parse('-12345-03-04')); // -12345-03-04 00:00:00.000
  print(DateTime.parse('2020-01-02 07')); // 2020-01-02 07:00:00.000
  print(DateTime.parse('2020-01-02T07')); // 2020-01-02 07:00:00.000
  print(DateTime.parse('2020-01-02T07:12')); // 2020-01-02 07:12:00.000
  print(DateTime.parse('2020-01-02T07:12:50')); // 2020-01-02 07:12:50.000
  print(DateTime.parse('2020-01-02T07:12:50Z')); // 2020-01-02 07:12:50.000Z
  print(DateTime.parse('2020-01-02T07:12:50+07')); // 2020-01-02 00:12:50.000Z
  print(DateTime.parse('2020-01-02T07:12:50+0700')); // 2020-01-02 00:12:50.00
  print(DateTime.parse('2020-01-02T07:12:50+07:00')); // 2020-01-02 00:12:50.00
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #string #date #format
ADD COMMENT
Topic
Name
5+2 =