Skip to content

Commit 0845a67

Browse files
committed
[stdlib/time] Update example
Signed-off-by: Flipez <[email protected]>
1 parent bee2c84 commit 0845a67

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/docs/builtins/Time.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdl
1616

1717

1818
```js
19-
🚀 » Time.format(Time.unix(), "%a %%b %b %e %H:%M:%S %Y")
20-
» "Mon %Oct Oct 31 00:28:37 2022"
19+
🚀 » Time.format(Time.unix(), "Mon Jan _2 15:04:05 2006")
20+
» "Mon Oct 31 00:08:10 2022"
2121
🚀 » Time.format(Time.unix(), "%a %b %e %H:%M:%S %Y")
2222
» "Mon Oct 31 00:28:43 2022"
2323
```
@@ -34,11 +34,9 @@ Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdl
3434

3535

3636
```js
37-
🚀 » a = "2022-03-23"
38-
» "2022-03-23"
39-
🚀 » format = "2006-01-02"
40-
» "2006-01-02"
41-
🚀 » Time.parse(a, format)
37+
🚀 » Time.parse("2022-03-23", "2006-01-02")
38+
» 1647993600
39+
🚀 » Time.parse("2022-03-23", "%Y-%m-%d")
4240
» 1647993600
4341
```
4442

stdlib/time.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdl
6565
ReturnPattern: object.Args(
6666
object.Arg(object.STRING_OBJ),
6767
),
68-
Example: `🚀 » Time.format(Time.unix(), "%a %%b %b %e %H:%M:%S %Y")
69-
» "Mon %Oct Oct 31 00:28:37 2022"
68+
Example: `🚀 » Time.format(Time.unix(), "Mon Jan _2 15:04:05 2006")
69+
» "Mon Oct 31 00:08:10 2022"
7070
🚀 » Time.format(Time.unix(), "%a %b %e %H:%M:%S %Y")
7171
» "Mon Oct 31 00:28:43 2022"`,
7272
},
@@ -93,11 +93,9 @@ Take a look at [the source](https://github.com/Flipez/rocket-lang/blob/main/stdl
9393
ReturnPattern: object.Args(
9494
object.Arg(object.STRING_OBJ),
9595
),
96-
Example: `🚀 » a = "2022-03-23"
97-
» "2022-03-23"
98-
🚀 » format = "2006-01-02"
99-
» "2006-01-02"
100-
🚀 » Time.parse(a, format)
96+
Example: `🚀 » Time.parse("2022-03-23", "2006-01-02")
97+
» 1647993600
98+
🚀 » Time.parse("2022-03-23", "%Y-%m-%d")
10199
» 1647993600`,
102100
},
103101
func(_ object.Environment, args ...object.Object) object.Object {

0 commit comments

Comments
 (0)