Answers for "flutter date from string"

8

flutter datetime to string

dependencies:
  intl: ^0.17.0
  
import 'package:intl/intl.dart';

DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm:ss");

String string = dateFormat.format(DateTime.now()); //Converting DateTime object to String

DateTime dateTime = dateFormat.parse("2019-07-19 8:40:23"); //Converting String to DateTime object
Posted by: Guest on August-20-2021
17

flutter datetime format

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd – kk:mm').format(now);
Posted by: Guest on September-10-2020
1

flutter string to date time

DateTime.parse("string date here");
Posted by: Guest on September-15-2021
0

convert date in flutter

import 'package:intl/intl.dart';

String? convertiEnDateEtHeure(n) {
  String date = DateFormat.yMMMd().add_Hm().format(n);

  return date;
}
Posted by: Guest on September-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language