Date time conversion in Javascript from format "/Date(1535515200000)/"

Webber

Hi All this is mostly asked question still i didn't find easy and direct way to convert this in to date format.

current format is in

"/Date(1535515200000)/"

if i executed the below line that will give the needed date format. Is there any direct way to get the date format from "/Date(1535515200000)/" to Wed Aug 29 2018 00:00:00 GMT-0400 (Eastern Daylight Time)

new Date(1535515200000)
Philipp
var s = "/Date(1535515200000)/";
var ts = s.substring(s.indexOf('(')+1,s.lastIndexOf(')'));
console.log(new Date(Number(ts)).toISOString());

Would print "2018-08-29T04:00:00.000Z"

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to change Date/Time format to English?

分類Dev

How to get current date time format in SQlite?

分類Dev

Changing date format javascript

分類Dev

What is this date and time format?

分類Dev

Could not print time after conversion from string format

分類Dev

PHP: How to take Date/Time from a form, format to a String and then insert into database?

分類Dev

PHP date() to Excel serial format conversion

分類Dev

Javascript to return time in format 00.00.00 from 0.0.0

分類Dev

How to extract the just the date from a file path string that also includes time with the format 2020.04.12.10.30.10?

分類Dev

pandas date-time format VS google sheets date format

分類Dev

Default Date to JSON conversion format in Angular app

分類Dev

Date conversion to specific format using Angular pipes

分類Dev

Karati Api - Validating date and time format

分類Dev

Inconsistent date time format for German locale

分類Dev

Need to Get the time in correct format from JavaScript to ISODateString?

分類Dev

Conversion failed when converting date and/or time from character string - but no idea why

分類Dev

Convert miliseconds to date and time and format by locale

分類Dev

R : how to define date and time format

分類Dev

Excel Date& Time Conversion

分類Dev

Parse Date and Time in specific format

分類Dev

Converting date and time from String format to Python datetime object: ValueError: time data '... p.m.' does not match format '... %p'

分類Dev

format a time series as dataframe with julian date

分類Dev

conversion failed when converting date and/or time from character string in xml

分類Dev

How to change date-time format?

分類Dev

Convert GMT date format to only time format

分類Dev

How to change the date/time format to English from the command line?

分類Dev

Javascript regext time format detection

分類Dev

How to convert date format in JavaScript?

分類Dev

convert text string to date/time format

Related 関連記事

  1. 1

    How to change Date/Time format to English?

  2. 2

    How to get current date time format in SQlite?

  3. 3

    Changing date format javascript

  4. 4

    What is this date and time format?

  5. 5

    Could not print time after conversion from string format

  6. 6

    PHP: How to take Date/Time from a form, format to a String and then insert into database?

  7. 7

    PHP date() to Excel serial format conversion

  8. 8

    Javascript to return time in format 00.00.00 from 0.0.0

  9. 9

    How to extract the just the date from a file path string that also includes time with the format 2020.04.12.10.30.10?

  10. 10

    pandas date-time format VS google sheets date format

  11. 11

    Default Date to JSON conversion format in Angular app

  12. 12

    Date conversion to specific format using Angular pipes

  13. 13

    Karati Api - Validating date and time format

  14. 14

    Inconsistent date time format for German locale

  15. 15

    Need to Get the time in correct format from JavaScript to ISODateString?

  16. 16

    Conversion failed when converting date and/or time from character string - but no idea why

  17. 17

    Convert miliseconds to date and time and format by locale

  18. 18

    R : how to define date and time format

  19. 19

    Excel Date& Time Conversion

  20. 20

    Parse Date and Time in specific format

  21. 21

    Converting date and time from String format to Python datetime object: ValueError: time data '... p.m.' does not match format '... %p'

  22. 22

    format a time series as dataframe with julian date

  23. 23

    conversion failed when converting date and/or time from character string in xml

  24. 24

    How to change date-time format?

  25. 25

    Convert GMT date format to only time format

  26. 26

    How to change the date/time format to English from the command line?

  27. 27

    Javascript regext time format detection

  28. 28

    How to convert date format in JavaScript?

  29. 29

    convert text string to date/time format

ホットタグ

アーカイブ