0

I have created a app which get the time from Mobile. I want to get the Date from google or by LocationManager . so how can i get it?

1 Answers1

0

well you can use new Date(); and this will return simply current date and time, also you can format date using SimpleDateFormat of java.util package

for example:

SimpleDateFormat simpleDateFormat=new SimpleDateFormat("EEE, MMM dd, yyyy");
        try {
            String date=  simpleDateFormat.format(new Date().getTime());
        } catch (ParseException e) {
            e.printStackTrace();
        }

so this will give output like MON, NOV 27, 2017

Umar Ata
  • 4,170
  • 3
  • 23
  • 35