mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
This commit is contained in:
17
docs/content/en/methods/duration/Abs.md
Normal file
17
docs/content/en/methods/duration/Abs.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Abs
|
||||
description: Returns the absolute value of the given time.Duration value.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: time.Duration
|
||||
signatures: [DURATION.Abs]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "-3h" }}
|
||||
{{ $d.Abs }} → 3h0m0s
|
||||
```
|
17
docs/content/en/methods/duration/Hours.md
Normal file
17
docs/content/en/methods/duration/Hours.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Hours
|
||||
description: Returns the time.Duration value as a floating point number of hours.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: float64
|
||||
signatures: [DURATION.Hours]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Hours }} → 3.5420833333333333
|
||||
```
|
17
docs/content/en/methods/duration/Microseconds.md
Normal file
17
docs/content/en/methods/duration/Microseconds.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Microseconds
|
||||
description: Returns the time.Duration value as an integer microsecond count.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: int64
|
||||
signatures: [DURATION.Microseconds]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Microseconds }} → 12751500000
|
||||
```
|
17
docs/content/en/methods/duration/Milliseconds.md
Normal file
17
docs/content/en/methods/duration/Milliseconds.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Milliseconds
|
||||
description: Returns the time.Duration value as an integer millisecond count.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: int64
|
||||
signatures: [DURATION.Milliseconds]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Milliseconds }} → 12751500
|
||||
```
|
17
docs/content/en/methods/duration/Minutes.md
Normal file
17
docs/content/en/methods/duration/Minutes.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Minutes
|
||||
description: Returns the time.Duration value as a floating point number of minutes.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: float64
|
||||
signatures: [DURATION.Minutes]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Minutes }} → 212.525
|
||||
```
|
17
docs/content/en/methods/duration/Nanoseconds.md
Normal file
17
docs/content/en/methods/duration/Nanoseconds.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Nanoseconds
|
||||
description: Returns the time.Duration value as an integer nanosecond count.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: int64
|
||||
signatures: [DURATION.Nanoseconds]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Nanoseconds }} → 12751500000000
|
||||
```
|
20
docs/content/en/methods/duration/Round.md
Normal file
20
docs/content/en/methods/duration/Round.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: Round
|
||||
description: Returns the result of rounding DURATION1 to the nearest multiple of DURATION2.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType:
|
||||
signatures: [DURATION1.Round DURATION2]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
|
||||
{{ $d.Round (time.ParseDuration "2h") }} → 4h0m0s
|
||||
{{ $d.Round (time.ParseDuration "3m") }} → 3h33m0s
|
||||
{{ $d.Round (time.ParseDuration "4s") }} → 3h32m32s
|
||||
```
|
17
docs/content/en/methods/duration/Seconds.md
Normal file
17
docs/content/en/methods/duration/Seconds.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Seconds
|
||||
description: Returns the time.Duration value as a floating point number of seconds.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: float64
|
||||
signatures: [DURATION.Seconds]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
{{ $d.Seconds }} → 12751.5
|
||||
```
|
21
docs/content/en/methods/duration/Truncate.md
Normal file
21
docs/content/en/methods/duration/Truncate.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Truncate
|
||||
description: Returns the result of rounding DURATION1 toward zero to a multiple of DURATION2.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
related:
|
||||
- functions/time/Duration
|
||||
- functions/time/ParseDuration
|
||||
returnType: time.Duration
|
||||
signatures: [DURATION1.Truncate DURATION2]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
|
||||
|
||||
{{ $d.Truncate (time.ParseDuration "2h") }} → 2h0m0s
|
||||
{{ $d.Truncate (time.ParseDuration "3m") }} → 3h30m0s
|
||||
{{ $d.Truncate (time.ParseDuration "4s") }} → 3h32m28s
|
||||
```
|
12
docs/content/en/methods/duration/_index.md
Normal file
12
docs/content/en/methods/duration/_index.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Duration methods
|
||||
linkTitle: Duration
|
||||
description: Use these methods with time.Duration values.
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: methods
|
||||
---
|
||||
|
||||
Use these methods with time.Duration values.
|
Reference in New Issue
Block a user