- 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.)
24 lines
376 B
Go
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)
|
|
}
|