time_offset_test.go 580 B

1234567891011121314151617181920212223
  1. package mhayaTime
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. func TestGlobalOffset(t *testing.T) {
  7. now := Now()
  8. t.Log(now.ToMillisecond(), " - ", now.ToDateTimeFormat())
  9. SubOffsetTime(SecondsPerDay * time.Second)
  10. nowOffset := Now()
  11. t.Log(nowOffset.ToMillisecond(), " - ", nowOffset.ToDateTimeFormat())
  12. nowBackup := nowOffset
  13. nowOffset.SubDay()
  14. t.Log(nowOffset.ToMillisecond(), " - ", nowOffset.ToDateTimeFormat())
  15. t.Log(nowBackup.ToMillisecond(), " - ", nowBackup.ToDateTimeFormat())
  16. nowOffset.AddDays(1)
  17. t.Log(nowOffset.ToMillisecond(), " - ", nowOffset.ToDateTimeFormat())
  18. }