最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

date - JavaScript TimeStamp into MilliSeconds - Stack Overflow

programmeradmin3浏览0评论

I have a timestamp that looks like 09-MAR-11 04.52.43.246000000 AM.

I'm trying to convert this to a time format into MilliSeconds , Could anybody please let me know as how to achieve this ?? ( I Should do this inside JavaScript Only )

Please advice . Thanks .

I have a timestamp that looks like 09-MAR-11 04.52.43.246000000 AM.

I'm trying to convert this to a time format into MilliSeconds , Could anybody please let me know as how to achieve this ?? ( I Should do this inside JavaScript Only )

Please advice . Thanks .

Share Improve this question edited Jun 9, 2011 at 20:52 kapa 78.7k21 gold badges165 silver badges178 bronze badges asked Mar 24, 2011 at 7:10 user663724user663724
Add a ment  | 

1 Answer 1

Reset to default 10

parse(): Returns the number of milliseconds since midnight 1 January 1970 for a given date and time string passed to it.

var milliSeconds = Date.parse('09-MAR-11 04:52:43:246000000 AM');

In your datestring please change the hour/min/etc separator to : instead of ., so JS can recognize correctly the date.

jsFiddle Demo

Javascript Date Functions

发布评论

评论列表(0)

  1. 暂无评论