mirror of https://github.com/jumpserver/jumpserver
parent
fbde8d42fe
commit
9304a911ea
@ -0,0 +1 @@
|
||||
__author__ = 'Hudie'
|
@ -0,0 +1,17 @@
|
||||
import time
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.filter(name='stamp2str')
|
||||
def stamp2str(value):
|
||||
try:
|
||||
return time.strftime('%Y/%m/%d %H:%M:%S', time.localtime(value))
|
||||
except AttributeError:
|
||||
return '0000/00/00 00:00:00'
|
||||
|
||||
|
||||
@register.filter(name='int2str')
|
||||
def int2str(value):
|
||||
return str(value)
|
Loading…
Reference in new issue