From 417ca571de9dbb609cf28a68b4387291f776caf6 Mon Sep 17 00:00:00 2001 From: xoy Date: Sat, 28 Jan 2023 22:22:13 +0100 Subject: [PATCH] fehlerbehebung --- func.go | 8 ++++---- main.go | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/func.go b/func.go index 7d56233..20b4f4f 100644 --- a/func.go +++ b/func.go @@ -9,8 +9,8 @@ import ( ) func logger(input string) { - println("[" + time.Now().Format("15:04:05 CET") + "] " + input) - fileAddLine("["+time.Now().Format("15:04:05 CET")+"] "+input, "./log/"+time.Now().Format("2006-02-01 CET")+".log") + println("[" + time.Now().Format("15:04:05") + "] " + input) + fileAddLine("["+time.Now().Format("15:04:05")+"] "+input, "./log/"+time.Now().Format("2006-02-01")+".log") } func handler() { @@ -212,7 +212,7 @@ func getNextTopic() topic { var output topic for i := 0; i < 31; i++ { - newDate := stringSplit(date.AddDate(0, 0, 1*i).Format("Mon Jan _2 15:04:05 CET 2006"), " ") + newDate := stringSplit(date.AddDate(0, 0, 1*i).Format(time.UnixDate), " ") if newDate[0] == "Thu" || newDate[0] == "Tue" { dayA, errA := strconv.Atoi(newDate[2]) @@ -222,7 +222,7 @@ func getNextTopic() topic { errorPanic(errB) if ifFloatRange(float64(dayA)/7, 0, 1, false, true) || (ifFloatRange(float64(dayB)/7, 2, 3, false, true) && newDate[0] == "Tue") { - output.date = date.AddDate(0, 0, 1*i).Format("02.01.2006 CET") + output.date = date.AddDate(0, 0, 1*i).Format("02.01.2006") output.days = i break } diff --git a/main.go b/main.go index 4b3fe88..4044612 100644 --- a/main.go +++ b/main.go @@ -4,13 +4,23 @@ import ( "net/http" ) +/* + +Timezone = UTC + +*/ + func main() { addr := readHttpYML() - logger("Connection open with address " + addr) + logger("----------------START----------------") + logger("timezone = UTC") + logger("connection open with address " + addr) handler() err := http.ListenAndServe(addr, nil) errorPanic(err) + + defer logger("----------------END----------------") }