Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8623

Re: Date Format

$
0
0

Hi Dhinesh,

 

I think I have a solution for your problem:

 

var value1= JSON.stringify(response.cost_date);

console.log(value1);                  // e.g. "/Date(1376179200000)/"

value1 = value.substring(7,20);   // maybe it's safer to work with regular expressions

console.log(value1);                  // 1376179200000

 

 

jQuery.sap.require("sap.ui.core.format.DateFormat");

var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern: "yyyy/MM/dd"});

console.log( oDateFormat.format(new Date(Number(value1))));  // 2013/08/11

 

 

RW



Viewing all articles
Browse latest Browse all 8623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>