Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

convert timeofday to string flutter

String formatTimeOfDay(TimeOfDay tod) {
    final now = new DateTime.now();
    final dt = DateTime(now.year, now.month, now.day, tod.hour, tod.minute);
    final format = DateFormat.jm();  //"6:00 AM"
    return format.format(dt);
}
Source by alvinalexander.com #
 
PREVIOUS NEXT
Tagged: #convert #timeofday #string #flutter
ADD COMMENT
Topic
Name
4+6 =