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

date now dart

import 'package:intl/intl.dart';
static final DateTime now = DateTime.now();

Want to format?

static final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  
OR

DateTime dateToday = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day) ;
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 :: dart concat string and int 
Dart :: color textfield text flutter 
Dart :: snackbar flutter 
Dart :: expansion tile widget flutter opening one at time 
Dart :: Flutter For In loop explained 
Dart :: flutter appbar remove padding 
Dart :: how to make unordered list in flutter 
Dart :: flutter concat lists 
Dart :: flutter disable container 
Dart :: could not find dart in your flutter sdk. please run 
Dart :: dart object to map 
Dart :: how to sort and order a list by date in flutter 
Dart :: empty widget in flutter 
Dart :: flutter cupertinoapp 
Dart :: flutter slider 
Dart :: dart interfaces 
Dart :: print an object dart 
Dart :: dart double to int 
Dart :: flutter api service example 
Dart :: dart if else 
Dart :: flutter how to create text with line on bot 
Dart :: use search delegate flutter firebase 
Dart :: speedometer in flutter 
Dart :: flutter fittedbox max value 
Dart :: app bar color flutter 
Dart :: flutter dollar sign interpolation 
Dart :: arrow upwars button flutter 
Dart :: This constructor cannot be used in null-safe code. Use [List.filled] to create a non-empty list. 
Swift :: swift uiview add tap gesture 
Swift :: uistackview insets 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =