0
I’m having trouble presenting the uptime time of an equipment, Django automatically shows in the following format:
I would like to present this time value in Portuguese.
in the settings.py
Timezone settings are as follows:
LANGUAGE_CODE = 'pt-br'
LOCALE_NAME = 'pt_BR'
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True
USE_L10N = True
USE_TZ = True
the template looks like this:
<tr>
<td>Uptime:</td>
<td>{{ status.uptime }}</td>
</tr>
and the value shown is obtained in this way:
obj['uptime'] = (datetime.now().replace(microsecond=0) - obj['last_up'])
Thanks in advance for your attention.
What type of variable is being passed to the template? How is the template?
– Paulo Marques
the template looks like this: <tr> <td>Uptime:</td> <td>{{ status.uptime }}</td> </tr> and the value shown is obtained like this: obj['uptime'] = (datetime.now(). replace(microsecond=0) - obj['last_up'])
– Baagrel
updates your post with code
– Paulo Marques