SQLAlchemy - Convert sqlalchemy.sql.functions.now() to Unix epoch (with fraction)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I'm using Doubles to track time in my database (as Unix timestamps with fractional portions). For that, I've created the following user type (that takes pytz-aware datetimes from the application and converts them to UTC timestamps).



from sqlalchemy.types import TypeDecorator, Float

class DoubleDatetime(TypeDecorator):

impl = Float

def __init__(self):
TypeDecorator.__init__(self, as_decimal=False)

def process_bind_param(self, value, dialect):
return value.timestamp()

def process_result_value(self, value, dialect):
return datetime.datetime.utcfromtimestamp(value)


This works fine for all datetimes in my system. I'm using the following column definition to have the database (in my case, SQLite3) insert the transaction time:



from sqlalchemy import Column
from sqlalchemy.sql.functions import now

column = Column("transaction_begin", DoubleDatetime, server_default=now())


Despite defining the transaction_begin column as a DoubleDatetime, my database still stores the records with a string.



How can I force the server transaction timestamp to use fractional Unix epochs?



What have I tried?



Reading the SQLite3 docs, I know I need to do some Julian Day trickery to do this.



SELECT (julianday('now') - 2440587.5) * 86400.0;


But I can't find julianday in sqlalchemy.sql.functions, to wrap it in a zero-argument lambda (to pass as the server_default arg to Column).



I tried the following, but it doesn't seem to work.



from sqlalchemy import text    
server_default = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")


Nor does the following:



from sqlalchemy.sql import select, text
server_default = select([text("(julianday('now') - 2440587.5) * 86400.0;")])


Traceback:



Traceback (most recent call last):
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: near "SELECT": syntax error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "tasks.py", line 81, in <module>
metadata.create_all(engine)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4005, in create_all
tables=tables)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1940, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1549, in _run_visitor
**kwargs).traverse_single(element)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
return meth(obj, **kw)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 757, in visit_metadata
_is_metadata_operation=True)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
return meth(obj, **kw)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 791, in visit_table
include_foreign_key_constraints=include_foreign_key_constraints
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1009, in _execute_ddl
compiled
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "SELECT": syntax error [SQL: "nCREATE TABLE barchartbarmessage (ntsymbol VARCHAR NOT NULL, ntdate DATE NOT NULL, ntopen NUMERIC, nthigh NUMERIC, ntlow NUMERIC, ntclose NUMERIC, ntvolume INTEGER, ntprevious_day_open_interest INTEGER, ntprevious_day_volume INTEGER, ntmessage_time FLOAT, nttransaction_begin FLOAT DEFAULT SELECT (julianday('now') - 2440587.5) * 86400.0; NOT NULL, nttransaction_end FLOAT, ntPRIMARY KEY (symbol, date, transaction_begin)n)nn"] (Background on this error at: http://sqlalche.me/e/e3q8)









share|improve this question































    2















    I'm using Doubles to track time in my database (as Unix timestamps with fractional portions). For that, I've created the following user type (that takes pytz-aware datetimes from the application and converts them to UTC timestamps).



    from sqlalchemy.types import TypeDecorator, Float

    class DoubleDatetime(TypeDecorator):

    impl = Float

    def __init__(self):
    TypeDecorator.__init__(self, as_decimal=False)

    def process_bind_param(self, value, dialect):
    return value.timestamp()

    def process_result_value(self, value, dialect):
    return datetime.datetime.utcfromtimestamp(value)


    This works fine for all datetimes in my system. I'm using the following column definition to have the database (in my case, SQLite3) insert the transaction time:



    from sqlalchemy import Column
    from sqlalchemy.sql.functions import now

    column = Column("transaction_begin", DoubleDatetime, server_default=now())


    Despite defining the transaction_begin column as a DoubleDatetime, my database still stores the records with a string.



    How can I force the server transaction timestamp to use fractional Unix epochs?



    What have I tried?



    Reading the SQLite3 docs, I know I need to do some Julian Day trickery to do this.



    SELECT (julianday('now') - 2440587.5) * 86400.0;


    But I can't find julianday in sqlalchemy.sql.functions, to wrap it in a zero-argument lambda (to pass as the server_default arg to Column).



    I tried the following, but it doesn't seem to work.



    from sqlalchemy import text    
    server_default = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")


    Nor does the following:



    from sqlalchemy.sql import select, text
    server_default = select([text("(julianday('now') - 2440587.5) * 86400.0;")])


    Traceback:



    Traceback (most recent call last):
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
    sqlite3.OperationalError: near "SELECT": syntax error

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "tasks.py", line 81, in <module>
    metadata.create_all(engine)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4005, in create_all
    tables=tables)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1940, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1549, in _run_visitor
    **kwargs).traverse_single(element)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 757, in visit_metadata
    _is_metadata_operation=True)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 791, in visit_table
    include_foreign_key_constraints=include_foreign_key_constraints
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1009, in _execute_ddl
    compiled
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
    raise value.with_traceback(tb)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
    File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
    sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "SELECT": syntax error [SQL: "nCREATE TABLE barchartbarmessage (ntsymbol VARCHAR NOT NULL, ntdate DATE NOT NULL, ntopen NUMERIC, nthigh NUMERIC, ntlow NUMERIC, ntclose NUMERIC, ntvolume INTEGER, ntprevious_day_open_interest INTEGER, ntprevious_day_volume INTEGER, ntmessage_time FLOAT, nttransaction_begin FLOAT DEFAULT SELECT (julianday('now') - 2440587.5) * 86400.0; NOT NULL, nttransaction_end FLOAT, ntPRIMARY KEY (symbol, date, transaction_begin)n)nn"] (Background on this error at: http://sqlalche.me/e/e3q8)









    share|improve this question



























      2












      2








      2








      I'm using Doubles to track time in my database (as Unix timestamps with fractional portions). For that, I've created the following user type (that takes pytz-aware datetimes from the application and converts them to UTC timestamps).



      from sqlalchemy.types import TypeDecorator, Float

      class DoubleDatetime(TypeDecorator):

      impl = Float

      def __init__(self):
      TypeDecorator.__init__(self, as_decimal=False)

      def process_bind_param(self, value, dialect):
      return value.timestamp()

      def process_result_value(self, value, dialect):
      return datetime.datetime.utcfromtimestamp(value)


      This works fine for all datetimes in my system. I'm using the following column definition to have the database (in my case, SQLite3) insert the transaction time:



      from sqlalchemy import Column
      from sqlalchemy.sql.functions import now

      column = Column("transaction_begin", DoubleDatetime, server_default=now())


      Despite defining the transaction_begin column as a DoubleDatetime, my database still stores the records with a string.



      How can I force the server transaction timestamp to use fractional Unix epochs?



      What have I tried?



      Reading the SQLite3 docs, I know I need to do some Julian Day trickery to do this.



      SELECT (julianday('now') - 2440587.5) * 86400.0;


      But I can't find julianday in sqlalchemy.sql.functions, to wrap it in a zero-argument lambda (to pass as the server_default arg to Column).



      I tried the following, but it doesn't seem to work.



      from sqlalchemy import text    
      server_default = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")


      Nor does the following:



      from sqlalchemy.sql import select, text
      server_default = select([text("(julianday('now') - 2440587.5) * 86400.0;")])


      Traceback:



      Traceback (most recent call last):
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
      sqlite3.OperationalError: near "SELECT": syntax error

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
      File "tasks.py", line 81, in <module>
      metadata.create_all(engine)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4005, in create_all
      tables=tables)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1940, in _run_visitor
      conn._run_visitor(visitorcallable, element, **kwargs)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1549, in _run_visitor
      **kwargs).traverse_single(element)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
      return meth(obj, **kw)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 757, in visit_metadata
      _is_metadata_operation=True)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
      return meth(obj, **kw)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 791, in visit_table
      include_foreign_key_constraints=include_foreign_key_constraints
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
      return meth(self, multiparams, params)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
      return connection._execute_ddl(self, multiparams, params)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1009, in _execute_ddl
      compiled
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
      exc_info
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb, cause=cause)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
      raise value.with_traceback(tb)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
      sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "SELECT": syntax error [SQL: "nCREATE TABLE barchartbarmessage (ntsymbol VARCHAR NOT NULL, ntdate DATE NOT NULL, ntopen NUMERIC, nthigh NUMERIC, ntlow NUMERIC, ntclose NUMERIC, ntvolume INTEGER, ntprevious_day_open_interest INTEGER, ntprevious_day_volume INTEGER, ntmessage_time FLOAT, nttransaction_begin FLOAT DEFAULT SELECT (julianday('now') - 2440587.5) * 86400.0; NOT NULL, nttransaction_end FLOAT, ntPRIMARY KEY (symbol, date, transaction_begin)n)nn"] (Background on this error at: http://sqlalche.me/e/e3q8)









      share|improve this question
















      I'm using Doubles to track time in my database (as Unix timestamps with fractional portions). For that, I've created the following user type (that takes pytz-aware datetimes from the application and converts them to UTC timestamps).



      from sqlalchemy.types import TypeDecorator, Float

      class DoubleDatetime(TypeDecorator):

      impl = Float

      def __init__(self):
      TypeDecorator.__init__(self, as_decimal=False)

      def process_bind_param(self, value, dialect):
      return value.timestamp()

      def process_result_value(self, value, dialect):
      return datetime.datetime.utcfromtimestamp(value)


      This works fine for all datetimes in my system. I'm using the following column definition to have the database (in my case, SQLite3) insert the transaction time:



      from sqlalchemy import Column
      from sqlalchemy.sql.functions import now

      column = Column("transaction_begin", DoubleDatetime, server_default=now())


      Despite defining the transaction_begin column as a DoubleDatetime, my database still stores the records with a string.



      How can I force the server transaction timestamp to use fractional Unix epochs?



      What have I tried?



      Reading the SQLite3 docs, I know I need to do some Julian Day trickery to do this.



      SELECT (julianday('now') - 2440587.5) * 86400.0;


      But I can't find julianday in sqlalchemy.sql.functions, to wrap it in a zero-argument lambda (to pass as the server_default arg to Column).



      I tried the following, but it doesn't seem to work.



      from sqlalchemy import text    
      server_default = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")


      Nor does the following:



      from sqlalchemy.sql import select, text
      server_default = select([text("(julianday('now') - 2440587.5) * 86400.0;")])


      Traceback:



      Traceback (most recent call last):
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
      sqlite3.OperationalError: near "SELECT": syntax error

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
      File "tasks.py", line 81, in <module>
      metadata.create_all(engine)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4005, in create_all
      tables=tables)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1940, in _run_visitor
      conn._run_visitor(visitorcallable, element, **kwargs)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1549, in _run_visitor
      **kwargs).traverse_single(element)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
      return meth(obj, **kw)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 757, in visit_metadata
      _is_metadata_operation=True)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
      return meth(obj, **kw)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 791, in visit_table
      include_foreign_key_constraints=include_foreign_key_constraints
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
      return meth(self, multiparams, params)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
      return connection._execute_ddl(self, multiparams, params)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1009, in _execute_ddl
      compiled
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
      exc_info
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb, cause=cause)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
      raise value.with_traceback(tb)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
      context)
      File "/home/randm/Libraries/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
      cursor.execute(statement, parameters)
      sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "SELECT": syntax error [SQL: "nCREATE TABLE barchartbarmessage (ntsymbol VARCHAR NOT NULL, ntdate DATE NOT NULL, ntopen NUMERIC, nthigh NUMERIC, ntlow NUMERIC, ntclose NUMERIC, ntvolume INTEGER, ntprevious_day_open_interest INTEGER, ntprevious_day_volume INTEGER, ntmessage_time FLOAT, nttransaction_begin FLOAT DEFAULT SELECT (julianday('now') - 2440587.5) * 86400.0; NOT NULL, nttransaction_end FLOAT, ntPRIMARY KEY (symbol, date, transaction_begin)n)nn"] (Background on this error at: http://sqlalche.me/e/e3q8)






      python sqlalchemy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 at 18:35







      MikeRand

















      asked Jan 3 at 16:52









      MikeRandMikeRand

      2,17333253




      2,17333253
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026535%2fsqlalchemy-convert-sqlalchemy-sql-functions-now-to-unix-epoch-with-fraction%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026535%2fsqlalchemy-convert-sqlalchemy-sql-functions-now-to-unix-epoch-with-fraction%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          'app-layout' is not a known element: how to share Component with different Modules

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          WPF add header to Image with URL pettitions [duplicate]