DateTime format - Postback

DateTime format - Postback

singhswatsinghswat Posts: 20Questions: 7Answers: 0

I'm pulling data from SQL server and converting my date(from /Date(1541923200000)/) and displaying my date in to (10/10/2018)

but after some edit when I post back the data to server to save changes, in list i can see /Date(1541923200000)/

My code for reading the cell value
listtd.CreatedDate = table.cell(row, 12).data();

How do i get the formatted date "2018-10-12" so that i can save it in database?

thanks for the help!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    Hi @singhswat ,

    The best bet is to use Moment.js, that library allows you to convert date/time between various formats.

    Cheers,

    Colin

This discussion has been closed.