How get the current date and the timezone in numbers format

Viewed 2338

I want to print the current date in this format 2017/06/05 > Year/Month/Day and next to it, the current timezone in this format +3

I used this code

String DateToday  = DateFormat.getDateInstance().format(new Date());
String TZtoday = DateFormat.getTimeInstance().getTimeZone().getDisplayName();
txt.setText(DateToday + " | "+ TZtoday );

But, it shows like this:

Jun 5, 2017 | Arabia Standard Time

I want it like this:

2017/06/05 | +3

4 Answers
Related