toMSFromUTC static method
Converts UTC components to milliseconds since epoch.
Example:
int utcMS = DateProvider.toMSFromUTC(2024, 2, 6);
print(utcMS); // Output: milliseconds since epoch for 06-02-2024
Implementation
static int toMSFromUTC(
int year, [
int month = 1,
int day = 1,
int hour = 0,
int minute = 0,
int second = 0,
]) {
return DateTime.utc(
year,
month - 1,
day,
hour,
minute,
second,
).millisecondsSinceEpoch;
}