How to format date in Flutter

Usually we are using different formats for date according to our needs. How do you format date in Dart/Flutter using custom format. A dependency library can save us.

To use this we need to add and the following lines in the dependencies section of pubspec.yaml file and run my favorite Flutter command pub get 


Add the package using Import

import 'package:date_format/date_format.dart';

Using the formatDate function we can format date (not string ) as wanted with a list of formats as follows

    [dd, '/', mm, '/', yy]),

We can replace the ‘/’ (slash) with whatever we want. Here is the link to the package

Flutter Projects

Hivedb-Flutter Todo

This project store todo items locally using NoSQL database, Hivedb, which is written in dart. Damn blazingly fast

Flutter Project Planner

A MongoDB-Flutter cloud application for project management


A firebase – Flutter sample application for iOS and Android

Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.