python


Django tables2 dispalys time as am/pm instead of 24H standard


I'm currently working on a website in Django, where data from a MySQL database is shown with Django-Tables2. The issue is that all TIME fields in the database gets converted into am/pm instead of 24 hours as the standard should be from what I've gathered. I've seen multiple of people with the opposite issue but none of those solutions has worked. After googling and trying for almost a week, I'm not asking the community.
Is there a way to force the time standard for the TimeFormat fields in Django to correspond to the same format as the MySQL TIME (unlimited/24 hours)?
It would be very helpful as I'm currently displaying time intervals, and 00:25 which should be 25 minutes is shown as 12:25 pm.
class LoggTable(TableReport):
glider = tables.Column(accessor = 'glider.glider_id')
towing = tables.Column(accessor = 'towing.towing_id')
glider_pilot = tables.Column(accessor = 'glider_pilot.pilot_id')
towing_pilot = tables.Column(accessor = 'towing_pilot.pilot_id')
class Meta :
model = FlightData
exclude = ('max_height')
attrs = {'class': 'paleblue'}
We solved the issue, by including
TIME_FORMAT = 'H:i'
In our settings.py file, we tried similar different solutions before but didn't find this until now. We also set
USE_L10N = False

Related Links

PhantomJS - Permission Denied
Combining image RGB channels
Python input validation and edge case handling
Struggling with making a Python module accessible via PyPi
Finding the minimum and maximum of a list of arrays
Accessing Google Drive Spreadsheets with Python Gspread
py.test & pytest on Raspberry Pi : Differences ?
Find maximum of column for each business quarter pandas
placeholder functions in sympy
Django: how to chain 2 add() calls in 1 create()?
How to specify large integer literals in a readable way?
How to do `PUT` on Amazon S3 using Python Requests
Untangle re.findall capturing groups: 'list' object has no attribute 'join'
Twisted equivalent of ThreadPoolExecutor (in Scrapy pipeline)
numpy.minimum applied to pandas DataFrame and Series
Find the area of a bounding polygon that encloses a set of points

Categories

HOME
makefile
sas
reverse-engineering
drupal-7
google-contacts
youtube-livestreaming-api
reportportal
computer-vision
console
ios10
ipfs
getorgchart
google-shopping
pyyaml
jcl
tree-traversal
jogl
uiautomator
rworldmap
auditing
frp
xilinx-ise
configure
datadog
dhtmlx-scheduler
idl
npm-shrinkwrap
large-data
hashcat
inkscape
issue-tracking
haskell-pipes
s3cmd
rule
ddms
web-development-server
jrules
datalog
mod-fcgid
tuleap
number-theory
dimple.js
decompress
forerunnerdb
jexl
hpcc
iron.io
xib
vst
django-filer
multifile-uploader
ng2-material
selecteditem
cmocka
approval-tests
except
servlet-3.0
persistence.xml
insert-into
eyeql
python-winshell
response-headers
isml
consensus
lexicographic
django-1.6
and-operator
emma
io.js
android-looper
kraken.js
factors
visual-studio-addins
cling
appfog
template-haskell
ubuntu-11.10
pitch
die
v4l
querystringparameter
galaxy-tab
goliath
authenticode
phpcrawl
.app
squeel
clause
svn-hooks
j-interop
querypath
kpi
evb

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App