remove T from dateformat
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-05-22 00:14:16 +02:00
parent 3d67c5e815
commit 4edd409cc8
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ fun Application.module() {
install(ContentNegotiation) { install(ContentNegotiation) {
gson { gson {
setPrettyPrinting() setPrettyPrinting()
setDateFormat("yyyy-MM-dd'T'HH:mm:ss") setDateFormat("yyyy-MM-dd HH:mm:ss")
} }
} }

View File

@ -2,7 +2,7 @@
import requests import requests
import os.path import os.path
import json import json
from datetime import datetime import datetime
URL = "http://127.0.0.1:8080/sample" URL = "http://127.0.0.1:8080/sample"
@ -10,7 +10,7 @@ FILE = 'CommonStarling_102761_45.wav'
files = { files = {
"file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}), "file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}),
"description" : (None, json.dumps({"date" : today.strftime("%Y-%m-%d %H:%M:%S"), "device_id" : "123"}), "application/json") "description" : (None, json.dumps({"date" : datetime.date.today().strftime("%Y-%m-%d %H:%M:%S"), "device_id" : "123"}), "application/json")
} }
r = requests.post(URL,files=files) r = requests.post(URL,files=files)