Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
timestamp not updating
#2
try this:

import time
import datetime

def get_timestamp():
    t = time.time()
    return t, datetime.date.fromtimestamp(t)


t, ts = get_timestamp()
print('t: {}, timestamp: {}'.format(t, ts))
Reply


Messages In This Thread
timestamp not updating - by bowen73 - Aug-20-2017, 09:36 PM
RE: timestamp not updating - by Larz60+ - Aug-20-2017, 09:51 PM
RE: timestamp not updating - by bowen73 - Aug-20-2017, 10:06 PM
RE: timestamp not updating - by bowen73 - Aug-20-2017, 11:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in timestamp Led_Zeppelin 3 3,301 Jun-15-2022, 08:28 PM
Last Post: deanhystad
  error in timestamp Led_Zeppelin 0 1,031 Jun-10-2022, 07:59 PM
Last Post: Led_Zeppelin
  Timestamp is undefined ErnestTBass 7 8,042 Feb-16-2019, 08:27 PM
Last Post: snippsat
  matplotlib timestamp zero_shubh0 2 6,873 Dec-02-2016, 02:12 PM
Last Post: zero_shubh0

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020