getDateTime method
获取DateTime对象
Implementation
DateTime? getDateTime({bool? isUtc}) {
if (this == null) {
return null;
}
DateTime? dateTime = DateTime.tryParse(this!);
if (isUtc != null) {
if (isUtc) {
dateTime = dateTime?.toUtc();
} else {
dateTime = dateTime?.toLocal();
}
}
return dateTime;
}