0

So far I have thought about

Location - this has getTime() but I don't know how to set the location as a string instead of device location

String citytocheck = edittext.gettext().toString();

citytocheck is the name of a city/country/location here

How can I accomplish this? Even getting the timezone would be fine.

joe dacoolguy
  • 309
  • 2
  • 8
  • 18

1 Answers1

0

Do you mean:

import java.text.SimpleDateFormat; import java.util.Date;

public class Main {

    public static void main(String[] args) {
        Date date = new Date();  
        SimpleDateFormat sdf;  
        sdf = new SimpleDateFormat("dd MMM yyyy hh:mm:ss zzz");  
        System.out.println(sdf.format(date));  

    }

}
Lefteris Bab
  • 787
  • 9
  • 19