1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package mhayaTime
- import (
- "testing"
- )
- func TestMhayaTime_Now(t *testing.T) {
- now := Now()
- AddOffsetTime(-60)
- now1 := Now()
- t.Logf("now = %s, now-offset = %s\n", now.ToDateTimeFormat(), now1.ToDateTimeFormat())
- }
- func TestMhayaTime_Yesterday(t *testing.T) {
- yesterday := Yesterday()
- t.Log(yesterday.ToDateTimeFormat())
- }
- func TestMhayaTime_Tomorrow(t *testing.T) {
- yesterday := Tomorrow()
- t.Log(yesterday.ToDateTimeFormat())
- }
- func TestMhayaTime_CreateFromTimestamp(t *testing.T) {
- ct := CreateFromTimestamp(1614150502000)
- t.Log(ct.ToDateTimeFormat())
- }
- func TestMhayaTime_CreateFromDateTime(t *testing.T) {
- ct := CreateFromDateTime(2012, 12, 24, 23, 59, 59)
- t.Log(ct.ToDateTimeFormat())
- }
- func TestMhayaTime_CreateFromDate(t *testing.T) {
- ct := CreateFromDate(2012, 12, 24)
- t.Log(ct.ToDateTimeFormat())
- }
- func TestMhayaTime_CreateFromTime(t *testing.T) {
- ct := CreateFromTime(23, 59, 59)
- t.Log(ct.ToDateTimeFormat())
- }
|