Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel
Accepted Solution

Getting Time Zone from device

[ Edited ]

I'm trying to get current timezone from device.

I found in documentation that they are in CalendarSettings class (method currentSystemTimezone()) and CalendarSettings should be retrieved vie settings method in CalendarService. I cannot found any sample how to do this, looked in calendar sample, even modify it to get timezone, but without success. 

Anyone knows working sample for this?

 

Thx

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Getting Time Zone from device

I manage to do this, but with javascript in QML . If anyone is interested this code will return difference to GMT time in minutes 

 

var date = new Date;
var gmtMinutesOfset = date.getTimezoneOffset();

 

Developer
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition
My Carrier: giffgaff

Re: Getting Time Zone from device

I'm trying to get an instance of CalendarService (to check 12/24 hour clock setting), but can't:

 

undefined reference to `bb::pim::calendar::CalendarSettings::~CalendarSettings()'

 

I've tried a variety of ways of getting a CalendarService and calling settings() on it, but it all boils down to the above or variants of it.

__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Developer
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition
My Carrier: giffgaff

Re: Getting Time Zone from device

Oh, mine was as simple as missing, from my .pro file:

 

LIBS += -lbbpim
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org