“Flattern -Datumsformat” Code-Antworten

DateTime Dart Format Druck

//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
}
Glamorous Gibbon

Flutter -DateTime -Format

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd – kk:mm').format(now);
S.Mahdi

DateFormat Local FR Flutter

import 'package:intl/intl.dart';
import 'package:intl/date_symbol_data_local.dart';
Awful Antelope

Flattern -Datumsformat

Format Pattern                    Result
--------------                    -------
'EEE, MMM d, ''yy'                Wed, Jul 10, '96
'h:mm a'                          12:08 PM
'yyyyy.MMMMM.dd GGG hh:mm aaa'    01996.July.10 AD 12:08 PM
Clean Chicken

Flattern -Datumsformat

//add, intl Flutter package

DateTime datetime = DateTime.now();
print(datetime.toString());
//output: 2021-10-17 20:04:17.118089

String datetime1 = DateFormat("yyyy-MM-dd").format(datetime);
print(datetime1);
//output: 2021-10-17

String datetime2 = DateFormat.Hms().format(datetime);
print(datetime2);
//output (Time): 20:04:17

String datetime3 = DateFormat.MMMMEEEEd().format(datetime);
print(datetime3);
//output: Sunday, October 17
Defeated Deer

Ähnliche Antworten wie “Flattern -Datumsformat”

Fragen ähnlich wie “Flattern -Datumsformat”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen