Search
 
SCRIPT & CODE EXAMPLE
 

DART

datetime dart format print

//You can use the intl package https://pub.dev/packages/intl/install

import 'package:intl/intl.dart';

main() {
  final DateTime now = DateTime.now();
  final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  print(formatted); // something like 2013-04-20
}
Comment

how to format a date in Dart

import 'package:intl/intl.dart';

main() {
  final DateTime now = DateTime.now();
  final DateFormat formatter = DateFormat('yyyy-MM-dd');
  final String formatted = formatter.format(now);
  print(formatted); // something like 2013-04-20
}
Comment

PREVIOUS NEXT
Code Example
Dart :: const text style flutter 
Dart :: dateTime.now addyears dart 
Dart :: flutter datetime to string 
Dart :: flutter switch color 
Dart :: listtile remove padding flutter 
Dart :: round to decimal places dart 
Dart :: dart convert string to datetime 
Dart :: make scaffold scrollable flutter 
Dart :: flutter remove status bar 
Dart :: flutter tooltip circle border 
Dart :: close keyboard on button click flutter 
Dart :: setting backgroundColor for snack bar does not change background color 
Dart :: mark as deprecated dart 
Dart :: string to double dart 
Dart :: iran phone number regex 
Dart :: RotatedBox class - widgets library - Flutter API 
Dart :: dart json encode example 
Dart :: replace string in dart,replace string in dart using regex 
Dart :: image from assets in flutter 
Dart :: dart convert int to string 
Dart :: flutter safearea 
Dart :: flutter alertdialog actionsoverflowdirecation 
Dart :: dart exception 
Dart :: badge flutter 
Dart :: flutter make a container clickable 
Dart :: how to check screen orientation in flutter 
Dart :: flutter image size not working 
Dart :: flutter persistent header 
Dart :: for in dart 
Dart :: flutter = How to set Scrollbar colour in flutter? 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =