Skip to content

Commit 378ff84

Browse files
marwahahamaggiepint
authored andcommitted
The utcOffset must have a leading sign or be 'Z' (moment#410)
1 parent 5614c04 commit 378ff84

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/moment/03-manipulating/09-utc-offset.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ moment().utcOffset(480);
4646
```
4747

4848
`moment#utcOffset` will search the string for the first match of `+00:00 +0000
49-
-00:00 -0000`, so you can even pass an ISO8601 formatted string and the moment
49+
-00:00 -0000 Z`, so you can even pass an ISO8601 formatted string and the moment
5050
will be changed to that UTC offset.
5151

52-
Note that the string is required to start with the `+` or `-` character. Passing a string that
53-
does not start with `+` or `-` will be interpreted as if it were `"+00:00"`.
52+
Note that the string, if not 'Z', is required to start with the `+` or `-` character.
5453

5554
```javascript
5655
moment().utcOffset("2013-03-07T07:00:00+08:00");
@@ -69,5 +68,5 @@ One use of this feature is if you want to construct a moment with a specific tim
6968
offset using only numeric input values:
7069

7170
```javascript
72-
moment([2016, 0, 1, 0, 0, 0]).utcOffset(-5, true) // Equivalent to "2016-01-01T00:00:00-05:00"
71+
moment([2016, 0, 1, 0, 0, 0]).utcOffset(-5, true) // Equivalent to "2016-01-01T00:00:00-05:00"
7372
```

0 commit comments

Comments
 (0)