-2
I have the following string:
2016-06-08 - 10:08
I need to convert this string to the other format:
08-06-2016 10:08
How should I proceed?
function dateFormat(date) {
inputFormat = new java.text.SimpleDateFormat('dd-MM-yyyy');
inputText = "2012-11-17";
date = inputFormat.parse(inputText);
outputText = inputFormat.format(date);
alert(outputText);
};
All you have is string, just manipulate and create the format you want. What code you have so far?
– PauloHDSousa
Can you help me?
– durtto
What code do you have so far?
– PauloHDSousa
I updated @Paulohdsousa
– durtto
Where did you get java.text.Simpledateformat?
– PauloHDSousa
is a java class. I use Rhino javascript, a java implementation.
– durtto
Da uma olhada nisso inputText = new Date('2012-11-17');
alert(inputText.getDate() +'-'+ inputText.getMonth()+'-'+ inputText.getFullYear());
– PauloHDSousa