I use datepicker c angular material. Here\'s the code:
6条回答 余生分开走 (楼主) 2021-01-12 13:36 Similar to the accepted answer, but a little less verbose and will keep the hours/minutes/seconds. const dt = new Date(event.value); const tz = dt.getTimezoneOffset(); const seconds = (dt.getTime() / 1000) - (tz * 60); 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Similar to the accepted answer, but a little less verbose and will keep the hours/minutes/seconds.
const dt = new Date(event.value); const tz = dt.getTimezoneOffset(); const seconds = (dt.getTime() / 1000) - (tz * 60);