0
How to format a data timestamp for timestamp br. ex.
2015-02-03 15:37:00 para 03/02/2015 15:37:00
Obs: the date is a text
0
How to format a data timestamp for timestamp br. ex.
2015-02-03 15:37:00 para 03/02/2015 15:37:00
Obs: the date is a text
1
One of the forms can be as below:
String dataUS = "2015-02-03 15:37:00";
SimpleDateFormat oldFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat newFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
System.out.println(newFormat.format(oldFormat.parse(dataUS)));
Returning:
03/02/2015 15:37:00
See working on IDEONE.
Browser other questions tagged java android datetime formatting
You are not signed in. Login or sign up in order to post.
Always comes in this pattern?
– user28595
@Diegof, yes. It always comes in this pattern
– Herick
Same string format?
– user28595
Yes. The date always comes from a webservice.
– Herick
I mean, the output(formatted date) you expect has to be the correct string?
– user28595