Any way to parse a time string using Moment.js but ignore timezone info?

前端 未结 10 1657
深忆病人
深忆病人 2020-12-30 01:56

Given the volume of Timezone questions, I would have thought to be able to find the answer to this issue, but haven\'t had any success.

Is there a way using mo

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 02:18

    There are valid reasons to do what the OP is asking for. The easiest way to do this with Moment is using its parseZone(date) method. No futzing around with string manipulation or multiple calls. It effectively parses the date string as though it were in the browser's local time zone.

提交回复
热议问题