String sdatetime = "2021-12-04"; DateTime sdate = DateTime.parse(sdatetime); int stimestamp = sdate.microsecondsSinceEpoch; print(stimestamp); //output: 1638555300000000