Answers for "datetime to hours in flutter"

11

flutter get current date

import 'package:intl/intl.dart';

main() {
  static final DateTime now = DateTime.now();
  static final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  print(formatted); // something like 2013-04-20
}
// https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html
Posted by: Guest on July-11-2020
3

flutter datetime add hours

var today = new DateTime.now();
var fiftyDaysFromNow = today.add(new Duration(hours: 1));
Posted by: Guest on February-27-2020

Code answers related to "datetime to hours in flutter"

Browse Popular Code Answers by Language