changeset 2929:e5f5afa45451

Change basic in/out datetime format to RFC3339 * Allow the client to understand and give datetime values in relation to UTC, which can be used to receive and display datetimes in local time zones.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 04 Apr 2019 11:15:19 +0200
parents 074f2bb85584
children 1019f4d0e18f
files pkg/common/time.go
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/common/time.go	Wed Apr 03 18:47:37 2019 +0200
+++ b/pkg/common/time.go	Thu Apr 04 11:15:19 2019 +0200
@@ -4,16 +4,22 @@
 // SPDX-License-Identifier: AGPL-3.0-or-later
 // License-Filename: LICENSES/AGPL-3.0.txt
 //
-// Copyright (C) 2018 by via donau
+// Copyright (C) 2018, 2019 by via donau
 //   – Österreichische Wasserstraßen-Gesellschaft mbH
 // Software engineering by Intevation GmbH
 //
 // Author(s):
 //  * Sascha L. Teichmann <sascha.teichmann@intevation.de>
+//  * Bernhard E. Reiter <bernhard.reiter@intevation.de>
 
 package common
 
+import "time"
+
 const (
-	TimeFormat = "2006-01-02T15:04:05"
+	// time.RFC3339 equals "simplified ISO format as defined by ECMA-262"
+	//   https://tc39.github.io/ecma262/#sec-date-time-string-format
+	// and "SHOULD be used in new protocols on the Internet." (RFC section 5.6)
+	TimeFormat = time.RFC3339
 	DateFormat = "2006-01-02"
 )