I'm developing an app in which I'm saving the date and time in Firebase
and then retrieving it for the user to see.
What I want is I want user to see that time and date according to their local timezone. for ex - if the time and date saved in database is '2:07 PM' and 'Fri, Jun 24', then to the users in PST timezone, it should be shown as '1:37 AM' and 'Fri, Jun 24'.
Here's how I'm getting time and date:
DateFormat currentTime = new SimpleDateFormat("h:mm a");
final String time = currentTime.format(Calendar.getInstance().getTime());
DateFormat currentDate = new SimpleDateFormat("EEE, MMM d");
final String date = currentDate.format(Calendar.getInstance().getTime());
How can I achieve this?
Please let me know.