“format de date de flottement” Réponses codées

Impression du format Dart Dart DatTime

//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

Format de DateTime Flutter

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

format de date de flottement

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

format de date de flottement

//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

Réponses similaires à “format de date de flottement”

Questions similaires à “format de date de flottement”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code