0

I have been staring at the official documentation for a while but cannot figure out how to get it to output ago - it always says < time> before

How do I get the following code to output a few seconds ago

import pendulum
import time

d = pendulum.now()
time.sleep(5)

txt = d.diff_for_humans(pendulum.now())

print(txt)    # this displays     "a few seconds before"
Progman
  • 16,827
  • 6
  • 33
  • 48
Bill
  • 618
  • 6
  • 15

0 Answers0