Added additional logic for getRelativeTime function