Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

time.go 671B

12345678910111213141516171819202122232425262728
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package setting
  4. import (
  5. "time"
  6. "code.gitea.io/gitea/modules/log"
  7. )
  8. // DefaultUILocation is the location on the UI, so that we can display the time on UI.
  9. var DefaultUILocation = time.Local
  10. func loadTimeFrom(rootCfg ConfigProvider) {
  11. zone := rootCfg.Section("time").Key("DEFAULT_UI_LOCATION").String()
  12. if zone != "" {
  13. var err error
  14. DefaultUILocation, err = time.LoadLocation(zone)
  15. if err != nil {
  16. log.Fatal("Load time zone failed: %v", err)
  17. }
  18. log.Info("Default UI Location is %v", zone)
  19. }
  20. if DefaultUILocation == nil {
  21. DefaultUILocation = time.Local
  22. }
  23. }