Languages

Menu
Sites
Language
get roaming timezone/time on Tizen Javascript

Hi,

 

I am trying to get the roaming timezone or time from the phone.

Is there any way to achieve this ?
 

thanks.

 

Responses

3 Replies
Iqbal Hossain

hi 

For TimeZone

var newTZ = tizen.time.getLocalTimezone();
console.log ("Local time zone is " + newTZ);

For Current Time

var current_dt = tizen.time.getCurrentDateTime();
console.log ("current date / time is " + current_dt.toLocaleString());

Time API Guide: https://developer.tizen.org/community/tip-tech/time-api-guide

 

 

mekabe remain

thanks.

but that's not what I am looking for.

I can get the local time with that variable. But I also want to get the time in the origin country when the user is roaming. How can I get that ?

 

thanks.

 

Iqbal Hossain

As per my knowledge, there is no such direct api in tizen till now. 

You can find current time zone

console.log("The current time zone is " + tizen.time.getLocalTimezone());

Available time zones

var tzids = tizen.time.getAvailableTimezones();
console.log("The device supports " + tzids.length + " time zones.");

And time zone change listener

tizen.time.setTimezoneChangeListener(timezoneChangedCallback);
function timezoneChangedCallback()
{
   try
   {
      /* New time zone can be retrieved through tizen.time.getLocalTimezone() */
      var zone = tizen.time.getLocalTimezone();
      console.log("Time zone has been set to " + zone);
   }
}

And try to manage your requirements by these api ....

https://developer.tizen.org/development/guides/web-application/device-settings-and-systems/time-and-date-management