The easiest way to achieve this is by installing intl. google intl and find it in pub.dev follow the installation instruction and add it to pubspec.yml
import it
use it in the following syntax:
You have to open the class DateFormat()and then call the format method from that class. in the example above tx.date is of type DateTime from dart.
The intl package supports a broad range of date formatting patterns. Here's a list (taken from the official docs):