1
1

create_new_stock.py 463 B

12345678910111213
  1. from datetime import timedelta, datetime
  2. import model
  3. from model import cleanup
  4. if __name__ == '__main__':
  5. timeout = float(input('How long will the initial selling be available? (minutes):'))
  6. try:
  7. expiry = datetime.strptime(model.current_db_time(), '%Y-%m-%d %H:%M:%S') + timedelta(minutes=timeout)
  8. print(model.new_stock(expiry))
  9. cleanup()
  10. except OverflowError:
  11. print('The expiration time is too far in the future.')