Introduce DatetimePrintFormat

This commit is contained in:
Matthias
2020-06-09 08:07:34 +02:00
parent cbcf3dbb43
commit fbddfaeacf
6 changed files with 26 additions and 25 deletions

View File

@@ -16,6 +16,7 @@ from werkzeug.security import safe_str_cmp
from werkzeug.serving import make_server
from freqtrade.__init__ import __version__
from freqtrade.constants import DATETIME_PRINT_FORMAT
from freqtrade.rpc.rpc import RPC, RPCException
logger = logging.getLogger(__name__)
@@ -31,7 +32,7 @@ class ArrowJSONEncoder(JSONEncoder):
elif isinstance(obj, date):
return obj.strftime("%Y-%m-%d")
elif isinstance(obj, datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S")
return obj.strftime(DATETIME_PRINT_FORMAT)
iterable = iter(obj)
except TypeError:
pass