File: filetime_test.go

package info (click to toggle)
golang-github-bodgit-windows 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 96 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package windows_test

import (
	"fmt"
	"time"

	"github.com/bodgit/windows"
)

func ExampleNsecToFiletime() {
	ft := windows.NsecToFiletime(time.Date(2020, 7, 20, 17, 15, 10, 0, time.UTC).UnixNano())

	fmt.Println(ft)
	// Output: {1384030976 30826169}
}

func ExampleFiletime_Nanoseconds() { //nolint:nosnakecase
	ft := windows.Filetime{
		1384030976,
		30826169,
	}

	fmt.Println(time.Unix(0, ft.Nanoseconds()).UTC())
	// Output: 2020-07-20 17:15:10 +0000 UTC
}