On Fri, 20 Mar 2020, Jonathan Vanasco wrote:

The common approach to this situation is storing the data as a 24hour
timestamp in the database/sqlalchemy and converting it to a 12hour am/pm
for display/editing.

You could use a "12 hour" option and an enum column for am/pm or a string.
You're going to have a much easier time in the longterm by using a standard
timestamp though.

Jonathan,

I understand this working if the time to be entered is the current time, but
not if the time is different. For example, a sample collection time and its
analysis times will be different and, in my application, entered well after
they occured. That's why I'm asking for guidance.

For example, a sample could be taken on 1 June at 11:00 hours, transported
to the analytical laboratory where it was analyzed on 2 June at 13:50 hours.
The report is sent to the user on 10 June and those times are entered in the
application any time after that.

Regards,

Rich

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/alpine.LNX.2.20.2003201101410.2460%40salmo.appl-ecosys.com.

Reply via email to