toDate static method
String
toDate(
- int ms, {
- String? format,
- String? local,
- TimeFormats? timeFormat,
- DateFormats dateFormat = DateFormats.dateDMCY,
- String? separator,
Converts milliseconds since epoch to a formatted date string.
Example:
int myTime = DateProvider.currentMS;
String formattedDate = DateProvider.toDate(myTime, dateFormat: DateFormats.dateDMCY);
print(formattedDate); // Output: "06-02-2024"
Implementation
static String toDate(
int ms, {
String? format,
String? local,
TimeFormats? timeFormat,
DateFormats dateFormat = DateFormats.dateDMCY,
String? separator,
}) {
return ms.toDate(
format: format,
local: local,
timeFormat: timeFormat,
dateFormat: dateFormat,
separator: separator,
);
}