Python convert epoch time to day of the week
问题 How can I do this in Python? I just want the day of the week to be returned. >>> convert_epoch_time_to_day_of_the_week(epoch_time_in_miliseconds) >>> 'Tuesday' 回答1: ep = 1412673904406 from datetime import datetime print datetime.fromtimestamp(ep/1000).strftime("%A") Tuesday def ep_to_day(ep): return datetime.fromtimestamp(ep/1000).strftime("%A") 回答2: from datetime import date def convert_epoch_time_to_day_of_the_week(epoch_time_in_miliseconds): d = date.fromtimestamp(epoch_time_in_miliseconds