1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-23 22:23:47 +00:00
fiber/internal/go-ole/variant_date_amd64.go
vecpeng f98a9ba405
feature: print all routes message when server starts (#1677)
* feature: print all routes message when server starts

* feature: print all routes message when server starts

* feature:  print all routes message when server starts

* 🐛fix: errors unhandled

* 🐛fix: ignore child process and add some "-" to the table head

* 🐛fix: add printRoutesMessage for listener and listenTLS
2021-12-30 14:13:31 +01:00

22 lines
614 B
Go

//go:build windows && amd64
// +build windows,amd64
package ole
import (
"errors"
"syscall"
"time"
"unsafe"
)
// GetVariantDate converts COM Variant Time value to Go time.Time.
func GetVariantDate(value uint64) (time.Time, error) {
var st syscall.Systemtime
r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st)))
if r != 0 {
return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil
}
return time.Now(), errors.New("Could not convert to time, passing current time.")
}