postgresDate static method

String postgresDate(
  1. String? date
)

Implementation

static String postgresDate(String? date) {
  if(date == null) return '';
  DateTime dateTime = DateTime.parse(date).toLocal();
  String formattedDate;
  formattedDate = DateFormat('yyyy-MM-dd').format(dateTime);
  return formattedDate;
}