Created
August 2, 2020 04:43
-
-
Save DevKhalyd/d3735c1851a09fa76751a0f136fa6acf to your computer and use it in GitHub Desktop.
Unix Time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<int> getmillisecondsSinceEpochNowAndAfter() { | |
//Get this day | |
String value = DateTime.now().toString(); | |
//Get the only the date | |
String prefix = value.substring(0, 10); | |
//Today from 0 hours | |
var today = DateTime.parse("$prefix 00:00:00Z"); | |
//Tomorrow from 0 hours | |
var afterDay = today.add(Duration(days: 1)); | |
return [today.millisecondsSinceEpoch, afterDay.millisecondsSinceEpoch]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment