Answers for "date time to custom format flutter"

27

flutter datetime format

import 'package:intl/intl.dart';

DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd – kk:mm').format(now);
Posted by: Guest on September-10-2020
0

how to format timeofday in custom format flutter

showTimePicker(
        context: context,
        initialTime: TimeOfDay.now(),
        builder: (context, _) {
          return MediaQuery(
              data: MediaQuery.of(context).copyWith(
                  // Using 24-Hour format
                  alwaysUse24HourFormat: true),
                  // If you want 12-Hour format, just change alwaysUse24HourFormat to false or remove all the builder argument
              child: _);
});
Posted by: Guest on May-25-2021

Code answers related to "date time to custom format flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language