Documentation ¶
Overview ¶
Package windows is a collection of types native to Windows platforms but are useful on non-Windows platforms.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filetime ¶
Filetime mirrors the Windows FILETIME structure which represents time as the number of 100-nanosecond intervals that have elapsed since 00:00:00 UTC, January 1, 1601. This code is taken from the golang.org/x/sys/windows package where it's not available for non-Windows platforms however various file formats and protocols pass this structure about so it's useful to have it available for interoperability purposes.
func NsecToFiletime ¶
NsecToFiletime converts nanoseconds to the equivalent Filetime type.
Example ¶
package main import ( "fmt" "time" "github.com/bodgit/windows" ) func main() { ft := windows.NsecToFiletime(time.Date(2020, 7, 20, 17, 15, 10, 0, time.UTC).UnixNano()) fmt.Println(ft) }
Output: {1384030976 30826169}
func (*Filetime) Nanoseconds ¶
Nanoseconds returns Filetime ft in nanoseconds since Epoch (00:00:00 UTC, January 1, 1970).
Example ¶
package main import ( "fmt" "time" "github.com/bodgit/windows" ) func main() { //nolint:nosnakecase ft := windows.Filetime{ 1384030976, 30826169, } fmt.Println(time.Unix(0, ft.Nanoseconds()).UTC()) }
Output: 2020-07-20 17:15:10 +0000 UTC