How to get current date and time from DB using SQLAlchemy
Posted
by
bluish
on Stack Overflow
See other posts from Stack Overflow
or by bluish
Published on 2010-12-29T07:51:12Z
Indexed on
2010/12/29
7:54 UTC
Read the original article
Hit count: 290
I need to retrieve what's the current date and time for the database I'm connected with SQLAlchemy (not date and time of the machine where I'm running Python code). I've seen this functions, but they don't seem to do what they say:
>>> from sqlalchemy import *
>>> print func.current_date()
CURRENT_DATE
>>> print func.current_timestamp()
CURRENT_TIMESTAMP
Moreover it seems they don't need to be binded to any SQLAlchemy session or engine. It makes no sense...
Thanks!
© Stack Overflow or respective owner