Appium timezone and time

I want to know the connected device timezone and its time format with am/pm.

1 Like

@mykola-mokhnach - I couldn’t retrieve a device local time such as am or pm format by calling the following getDeviceTime function. I want to know the cloud device or connected device time then which function should I use to fetch it?

The format argument can be used to customize the resulting string format. Isn’t it working?

Sorry can u explain it in detail. getDeviceTime(format) is that r u saying?
how will i get to know about the device timezone?

@mykola-mokhnach Kindly give the solution ASAP.

String d=“2018-06-12T15:13:31+02:00”;
SimpleDateFormat isoFormat = new SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss”);
Date date = isoFormat.parse(d);
System.out.println(new SimpleDateFormat(“hh:mm:ss”).format(date)); // “03:13:31” - this is what I’m getting it when i run this snippet. But my goal is, with the time i want to know that its am or pm. So, accordingly i can do my actions on the timestamp.

@mykola-mokhnach Kindly provide the details for above content.