mysql - Getting server time and using it in python -
i have unique situation in need of pulling current time sql server , using value in python program string. don't know how pull down print or assign variable.
example:
do stuff... var = mysql server datetime <---- how do part ?? print var; more stuff...
you can use library _mysql connect server should work.
import _mysql db = _mysql.connect(host="localhost",user="user", passwd="pass", db="db") db.execute('select now()') r = db.store_result() time_var = r[0][0] print time_var
Comments
Post a Comment