Daylight savings time affecting date unix timestamp value
Đang mở
- Ngôn ngữ chính
- JavaScript
- Star
- 7.6k
- Fork
- 981
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi.
I'm currently setting the date value that is selected by users to a data attribute on the input as below.
$ELEMENT.attr("data-selectedDate", P.component.get( 'select' ).pick);
I'm getting a Unix timestamp returned x 1000 however I've noticed if the date that is being set is + / - one hour due to daylight savings, then the timestamp value is set to 23:00 as opposed to 00:00.
This only seems to cause an issue if you are trying to calculate the date range or number of nights from two date pickers where one of the dates are an hour ahead or behind. In this case you will end up with a decimal value in the returned number of nights.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.