Hello friends,
I have a query in my Azure Website, where i lookup for data information based on some ID of my table.
This is my code:
todoItemTable.lookup(parameterid).done(function (result) {
var retr = JSON.stringify(result);
var model = jQuery.parseJSON(retr);
descrevent = model.text;
tpevnt = model.tipoevento;
addr = model.address;
dtevnt = model.dateevent;
}, function (err) {
alert("Error: " + err);
})
At my SQL Database, the inserted date is correct. If i cast "Select * from MyTable", i can see that ID with simple data: 2012-11-05 (example).
But at my javascript, when i lookup the ID, the field "dtevnt" returns a date with long format: 2012-05-11T00:00:00.000Z.
How can i format this date into a simple date? (DD/MM/YYYY)
I tried to get this date, and use functions:
var yr = dtevnt.getFullYear();
or:
var yr = dtevnt.getDay();
And didn't work. When i use Date functions (like .getFullDay(); or .getDay()
at my code, the whole code doesn't work.
Someone can help'me formating "YYYY-MM-DDT00:00:00.000Z"(Jquery/JSON) to "DD/MM/YYYY"?
Thank you.