fromInt static method

String fromInt(
  1. int time, {
  2. String format = 'yyyy-MM-dd hh:mm:ss',
  3. TimeUnit timeUnit = TimeUnit.millisecond,
})

Get the time string in the specified format from the digital timestamp. time Timestamp to be processed. format Format time string. timeUnit The unit of the timestamp to be processed.

Implementation

static String fromInt(
  int time, {
  String format = 'yyyy-MM-dd hh:mm:ss',
  TimeUnit timeUnit = TimeUnit.millisecond,
}) {
  late IDKitTimeFormat idkitTimeFormat = IDKitTimeFormat();
  final DateTime dateTime = idkitTimeFormat.dateFromInt(time, timeUnit);
  return idkitTimeFormat.stringFrom(dateTime, format);
}