Christopher Wommack3,983 Points
What do I have wrong?
# If you need help, look up datetime.datetime.fromtimestamp() # Also, remember that you *will not* know how many timestamps # are coming in. import datetime def timestamp_oldest(*args): time_stamps= for ea in args: time_stamps.append(ea) time_stamps.sort(reverse=True) return datetime.datetime.fromtimestamp(time_stamps)
Robin Goyal4,581 Points
Since you're sorting with the condition that reverse = True, then your list of timestamps will have the newest one at the front of the list and the oldest timestamp at the end of the list. You're indexing at the second item of the list instead of the last item. To choose the last item, use an index of -1.
Luis Vasquez21,093 Points
def timestamp_oldest(*args): times = sorted([*args]) return datetime.datetime.fromtimestamp(times)