dateTimeFromDB static method

DateTime dateTimeFromDB(
  1. String src
)

Implementation

static DateTime dateTimeFromDB(String src) {
  if (src.isEmpty) return DateTime(1970, 1, 1).toLocal();
  //if (myConfig!.serverType == ServerType.appwrite) {
  try {
    return DateTime.parse(src).toLocal(); // yyyy-mm-ddThh:mm:ss.sss
  } catch (e) {
    return DateTime(1970, 1, 1).toLocal();
// yyyy-mm-ddThh:mm:ss.sssZ
  }
  //}
  //return src.toDate();
}