Search
 
SCRIPT & CODE EXAMPLE
 

DART

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
Comment

how to display current date time in flutter

main() {
    var now = new DateTime.now();
    var formatter = new DateFormat('yyyy-MM-dd');
    String formattedDate = formatter.format(now);
    print(formattedDate); // 2016-01-25
} 
Comment

how to display current date time in flutter

DateTime now = new DateTime.now();
DateTime date = new DateTime(now.year, now.month, now.day);
Comment

how to display current date time in flutter

DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ; 
Comment

get current date in dart

DateTime now = DateTime.now();
Comment

PREVIOUS NEXT
Code Example
Dart :: flutetr stepper color 
Dart :: python change type of elements in list 
Dart :: flutter clear navigation stack 
Dart :: flutter check if string is number 
Dart :: dateTime.now addyears dart 
Dart :: round container flutter 
Dart :: flutter copy to clipboard 
Dart :: bad state insecure http is not allowed flutter 
Dart :: flutter card border radius overflow hidden 
Dart :: how to check whether index is exist or not in dart 
Dart :: constrainedbox flutter 
Dart :: flutter launcher icon generate 
Dart :: setting backgroundColor for snack bar does not change background color 
Dart :: change font size flutter 
Dart :: floating action button rectangle flutter 
Dart :: flutter listtile color 
Dart :: flutter use png as icon 
Dart :: how to disable windows build flutter 
Dart :: flutter flotingactionbutton with text 
Dart :: add dollar sign in flutter 
Dart :: flutter button with icon and text 
Dart :: StateError (Bad state: No element) 
Dart :: flutter getit reset 
Dart :: how to convert timestamp to datetime in dart 
Dart :: raisedbutton full width flutter 
Dart :: flutter text direction rtl 
Dart :: listview flutter give padding to list bottom 
Dart :: convert date in flutter 
Dart :: convert timeofday to string flutter 
Dart :: flutter extend two classes 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =