Javascript Convert Date Time string to Epoch

后端 未结 8 831
攒了一身酷
攒了一身酷 2020-11-30 09:46

so I give up...been trying to do this all day;

I have a string that supplies a date and time in the format dd/MM/yyyy hh:mm (04/12/2012 07:00

8条回答
  •  渐次进展
    2020-11-30 10:16

    You can use the momentjs library to do this rather easily.

    var epoch = moment(str).unix();
    

    http://momentjs.com/

提交回复
热议问题