Dart: DateTIme class

void main(){
  final now = DateTime.now();
  print(now); // 2022-02-25 13:24:37.052
  print(now.toIso8601String()); // 2022-02-25T13:24:37.052
  print(now.toUtc().toIso8601String()); // 2022-02-25T04:24:37.052Z
  print(DateTime.parse(now.toString()).toLocal()); // 2022-02-25 13:24:37.052
}

TagTimes

Simple time tracking tool
Developed by Namu Works