Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format function with setted utcOffset does not work properly #808

Closed
veksa opened this issue Feb 28, 2020 · 4 comments · Fixed by #872
Closed

Format function with setted utcOffset does not work properly #808

veksa opened this issue Feb 28, 2020 · 4 comments · Fixed by #872
Labels

Comments

@veksa
Copy link

veksa commented Feb 28, 2020

Describe the bug
Format function with setted utcOffset does not work properly

Expected behavior

dayjs('2017-07-20T11:00:00+00:00').utcOffset(-12).format()

should equal to

moment('2017-07-20T11:00:00+00:00').utcOffset(-12).format()

and be '2017-07-19T23:00:00-12:00'

Information

  • Day.js Version v1.8.21
  • OS: Windows
  • Browser Chrome 80
  • Time zone: not zero
@iamkun
Copy link
Owner

iamkun commented Feb 29, 2020

seems no problem.

https://runkit.com/embed/32nc6n1cn8s2

Screen Shot 2020-02-29 at 1 06 41 PM

@veksa
Copy link
Author

veksa commented Mar 2, 2020

just use the same parameters, begin of day in your case with not zero local time:
https://runkit.com/embed/uhx3pxaltrns

@HumbertoMendes
Copy link

HumbertoMendes commented Mar 3, 2020

I'm having a similar issue where:
moment.utc("2020-03-09T15:00:00.0000000Z").utcOffset(-360).format();
results in:
2020-03-09T09:00:00-06:00
while:
dayjs.utc("2020-03-09T15:00:00.0000000Z").utcOffset(-360).format();
results in:
2020-03-09T10:00:00-06:00

https://runkit.com/humbertomendes/dayjs-utcoffset-issue

iamkun added a commit that referenced this issue Apr 17, 2020
iamkun added a commit that referenced this issue Apr 17, 2020
iamkun pushed a commit that referenced this issue Apr 21, 2020
## [1.8.25](v1.8.24...v1.8.25) (2020-04-21)

### Bug Fixes

* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](#873)) ([3cea04d](3cea04d)), closes [#849](#849)
* Fix Duration plugin get seconds ([#867](#867)) ([62b092d](62b092d))
* Fix type definition of locale ([9790b85](9790b85))
* Fix UTC plugin startOf, endOf bug ([#872](#872)) ([4141084](4141084)), closes [#809](#809) [#808](#808)
@iamkun
Copy link
Owner

iamkun commented Apr 21, 2020

🎉 This issue has been resolved in version 1.8.25 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.25](iamkun/dayjs@v1.8.24...v1.8.25) (2020-04-21)

### Bug Fixes

* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](iamkun/dayjs#873)) ([3cea04d](iamkun/dayjs@3cea04d)), closes [#849](iamkun/dayjs#849)
* Fix Duration plugin get seconds ([#867](iamkun/dayjs#867)) ([62b092d](iamkun/dayjs@62b092d))
* Fix type definition of locale ([9790b85](iamkun/dayjs@9790b85))
* Fix UTC plugin startOf, endOf bug ([#872](iamkun/dayjs#872)) ([4141084](iamkun/dayjs@4141084)), closes [#809](iamkun/dayjs#809) [#808](iamkun/dayjs#808)
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.25](iamkun/dayjs@v1.8.24...v1.8.25) (2020-04-21)

### Bug Fixes

* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](iamkun/dayjs#873)) ([3cea04d](iamkun/dayjs@3cea04d)), closes [#849](iamkun/dayjs#849)
* Fix Duration plugin get seconds ([#867](iamkun/dayjs#867)) ([62b092d](iamkun/dayjs@62b092d))
* Fix type definition of locale ([9790b85](iamkun/dayjs@9790b85))
* Fix UTC plugin startOf, endOf bug ([#872](iamkun/dayjs#872)) ([4141084](iamkun/dayjs@4141084)), closes [#809](iamkun/dayjs#809) [#808](iamkun/dayjs#808)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants