How I can show only current time using in flutter?


 DateTime currentTime = new;

  Widget CustomCards(Color frontColor, String fetchTime) {
    Card cards = new Card(
      elevation: 1.0,
      margin: const EdgeInsets.symmetric(horizontal: 2.0, vertical: 2.0),
      color: bgColor,
      shape: new RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(15.0),
      child: Column(
        children: [
            padding: const EdgeInsets.all(5.0),
            child: Row(
              children: [
                  padding: const EdgeInsets.only(left: 15.0),
                  child: Text(
                  style: new TextStyle(
                    fontStyle: FontStyle.italic,
                    fontFamily: 'Satisfy',
                    fontSize: 15.0,
                    color: frontColor,
    return cards;

How can I show the current time from DateTime, as it always shows the current date along with time but I want to show the time in format hh:mm:ss. Here seconds should be necessarily their. I am not able to find any logic please help me.
Thank You


Add Dependency in pubspec.yaml intl: ^0.16.1 (check latest dependency from then you can use DateFormat.yMMMd().format(; in your dart file. You can change Pattern of Date format based on your requirement.

For custom date pattern which does not exists in DateFormat set then you can use


Answered By – Nik

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *