1- pset7 I can't use usd() because I still need the values(int) to select the number for calculation

2- I used datetime.datetime.now()and it gives me just date without the time. anyone can help me :) thanks in advance!

    db.execute("INSERT INTO portfolio (user_id, name, symbol, shares_number,             
    price, total, date) VALUES (:user_id, :name, :symbol, :shares_number, :price, :total, 
    :date)",user_id = session["user_id"], name = results["name"], symbol = 
    results["symbol"], shares_number = number, \
    price = results["price"], total = cost, date = 

1 Answer 1


1)for time stamp you could use this..

from time import gmtime,strftime

    time=strftime("%Y-%m-%d %H:%M:%S", gmtime())

output will look like this.. 2017-12-28 09:40:20

now you could set date=time..to get the result

2)for the $ sign ..you may also just print it in the jinja template directly example

<td>${{ Price }}<td>

this would give the desired $24 type output

Hope this answers your question

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .