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 show date only in flutter

import 'package:intl/intl.dart';
String now = DateFormat("yyyy-MM-dd").format(DateTime.now());
Comment

flutter datetime.now only time

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedTime = DateFormat.Hms().format(now);
print(formattedTime);
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

how to show date only in flutter

dependencies:
  flutter:
    sdk: flutter
  intl: ^0.16.1
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter run in background every second 
Dart :: modify item in list dart 
Dart :: Flutter Dart - Difference Two DateTime 
Dart :: input in dart 
Dart :: alertdialog shape flutter 
Dart :: listview space between items flutter 
Dart :: dart convert string to double 
Dart :: how to make unordered list in flutter 
Dart :: Running Gradle task assembleDebug.... 
Dart :: flutter get available width 
Dart :: how to blur container in flutter 
Dart :: define offset for floatingActionButtonLocation flutter 
Dart :: Send HTTP Get request in Flutter or Dart 
Dart :: alertdialog padding flutter 
Dart :: leading in flutter(drawer) 
Dart :: swicth statement in flutter 
Dart :: upload zip file to ec2 
Dart :: dart class 
Dart :: flutter Scaffold.of() called with a context that does not contain a Scaffold 
Dart :: dart map clear 
Dart :: increase widh of TableCell in flutter 
Dart :: Concatenate two list in Flutter 
Dart :: rounded button flutter 
Dart :: install fvm in flutter using pub package 
Dart :: flutter cachImage 
Dart :: dart data structures 
Dart :: flutter test from sdk incomapatible with package or plugin 
Dart :: flutter list key value 
Dart :: flutter listview top padding 
Swift :: set image width and height swiftui 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =