Skip to content

Commit 0554cb3

Browse files
riazXrazorJanDeDobbeleer
authored andcommitted
docs: time format indications
1 parent 447ca4b commit 0554cb3

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

docs/docs/segment-time.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,49 @@ Show the current timestamp.
2525

2626
- time_format: `string` - format to use, follows the [golang standard][format] - defaults to `15:04:05`
2727

28-
[format]: https://gobyexample.com/time-formatting-parsing
28+
[format]: https://yourbasic.org/golang/format-parse-string-time-date-example/
2929

3030
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
31-
properties below. Only used when a value is set, making the above properties obsolete.
31+
properties below. Only used when a value is set, making the above properties obsolete.
3232

3333
example: `{{ now | date \"January 02, 2006 15:04:05 PM\" | lower }}`
3434

3535
## Template Properties
3636

3737
- `.CurrentDate`: `time` - The time to display(testing purpose)
38+
39+
### Standard time and date formats
40+
41+
- January 2, 2006 **Date**
42+
- 01/02/06
43+
- Jan-02-06
44+
- 15:04:05 **Time**
45+
- 3:04:05 PM
46+
- Jan _2 15:04:05 **Timestamp**
47+
- Jan _2 15:04:05.000000 **with microseconds**
48+
- 2006-01-02T15:04:05-0700 **ISO 8601 (RFC 3339)**
49+
- 2006-01-02
50+
- 15:04:05
51+
- 02 Jan 06 15:04 MST **RFC 822**
52+
- 02 Jan 06 15:04 -0700 **with numeric zone**
53+
- Mon, 02 Jan 2006 15:04:05 MST 27e95cb
54+
- Mon, 02 Jan 2006 15:04:05 -0700 **with numeric zone**
55+
56+
#### The following predefined date and timestamp format constants are also available
57+
58+
- ANSIC = "Mon Jan _2 15:04:05 2006"
59+
- UnixDate = "Mon Jan _2 15:04:05 MST 2006"
60+
- RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
61+
- RFC822 = "02 Jan 06 15:04 MST"
62+
- RFC822Z = "02 Jan 06 15:04 -0700"
63+
- RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
64+
- RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
65+
- RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700"
66+
- RFC3339 = "2006-01-02T15:04:05Z07:00"
67+
- RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
68+
- Kitchen = "3:04PM"
69+
// Useful time stamps.
70+
- Stamp = "Jan _2 15:04:05"
71+
- StampMilli = "Jan _2 15:04:05.000"
72+
- StampMicro = "Jan _2 15:04:05.000000"
73+
- StampNano = "Jan _2 15:04:05.000000000"

0 commit comments

Comments
 (0)