Untis-Logger/Untis/timeutil.go
Jannover5000r 1d57e8a867 made a lot of changes for the workflow of the bot
- Timezone handling got updated
- Logs have been deleted to avoid duplicates and clean up the terminal
- removed unused code
- fixed an issue where the updating time threw errors
- improvements to the updateting of timetable data, only using a single api call now
- improved init to intitialize all needed files (classrooms, subjects etc.)
2026-08-25 22:53:59 +02:00

24 lines
376 B
Go

package Untis
import (
"log"
"os"
"time"
"github.com/joho/godotenv"
)
var (
locerr error
Location *time.Location
)
func GetTime() time.Time {
godotenv.Load("../.env")
timezone := os.Getenv("LOCATION_ENV")
Location, locerr = time.LoadLocation(timezone)
if locerr != nil {
log.Fatalf("Failed to load Timezone: %v", locerr)
}
return time.Now().In(Location)
}