convertTimeToDateTimestamp function

String convertTimeToDateTimestamp(
  1. String timestamp,
  2. String format
)

Implementation

String convertTimeToDateTimestamp(String timestamp, String format) {
  String fdatetime = "";
  if(timestamp.isNotEmpty)
    {
      var date = DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
      fdatetime = DateFormat(format).format(date);
    }
  return fdatetime;
}