I'm getting a value of type Date
from the Database. Here is an example Wed Jul 29 13:03:00 GMT +03:00 2020
and I have the following method to convert it to string
public static final String VIEW_DATE_FORMAT = "dd MMM yyyy HH:mm";
public static String dateToString(Date date){
DateFormat dateFormat = new SimpleDateFormat(General.VIEW_DATE_FORMAT , Locale.getDefault());
if(date == null)
return "";
return dateFormat.format(date);
}
My Question is how to convert the date to the Local time zone of the device the app is installed on ?
I want the date to become Wed Jul 29 2020 16:03:00
but I'm getting Wed Jul 29 2020 13:03:00
instead