mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,20 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,17 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,21 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
@@ -1,12 +0,0 @@
|
||||
---
|
||||
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