mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 10:47:57 +08:00
d9f14c6a46
代码授权注释修改
36 lines
832 B
Go
36 lines
832 B
Go
//----------------------------------------
|
|
//
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
//
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
//----------------------------------------
|
|
|
|
package common
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestGoTimeToDTime(t *testing.T) {
|
|
for i := 0; i < 1; i++ {
|
|
var now = time.Now()
|
|
fmt.Println("now", now)
|
|
var dNow = GoDateTimeToDDateTime(now)
|
|
fmt.Println("dNow", dNow)
|
|
var gNow = DDateTimeToGoDateTime(dNow)
|
|
fmt.Println("gNow", gNow)
|
|
fmt.Println("==========")
|
|
}
|
|
//1/24 + (1/24)/60*x
|
|
//x=60162037037
|
|
fmt.Println(63422453704 * 1000 / int64(time.Second))
|
|
fmt.Println(62710648148 * 1000 / int64(time.Second))
|
|
sub := time.Now().Sub(time.Date(2022, 10, 5, 0, 0, 0, 0, time.UTC))
|
|
fmt.Println(sub.Seconds())
|
|
}
|