Hello I m trying to convert this string 0x278a51da into a integer so I can use it on the ctime from time

0 votes
time_in_hexa_format_as_string = '0x278a51da'
def get_time_stamp(value_for_time):
    import time
    date = time.ctime(value_for_time)
    return "Time from archive:", date

print(get_time_stamp(int(time_in_hexa_format_as_string)))
error: 
Traceback (most recent call last):
 line 103, in <module>
    print(get_time_stamp(int(time_in_hexa_format_as_string)))
ValueError: invalid literal for int() with base 10: '0x278a51da'
Jul 12, 2021 in Python by Rafael

edited 5 days ago 10 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP