getDateTimeDiff static method

Duration getDateTimeDiff(
  1. DateTime dateTime
)

Implementation

static Duration getDateTimeDiff(DateTime dateTime){
  DateTime currentDateTime = DateTime.now();
  return currentDateTime.difference(dateTime);
}