Debian Codegraph @

docs/content/en/methods/time/Unix.md

raw
1 ---
2 title: Unix
3 description: Returns the given time.Time value expressed as the number of seconds elapsed since January 1, 1970 UTC.
4 categories: []
5 params:
6 functions_and_methods:
7 returnType: int64
8 signatures: [TIME.Unix]
9 aliases: [/functions/unix]
10 ---
11
12 See [Unix epoch][].
13
14 ```go-html-template
15 {{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
16 {{ $t.Unix }} → 1674891898
17 ```
18
19 [Unix epoch]: https://en.wikipedia.org/wiki/Unix_time