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

Posts: 76
Registered: ‎02-08-2013
My Device: z10
My Carrier: rogers
Accepted Solution

DateTimePicker Confused about Epoch?

Something quite unusual is happening, it looks like the DateTimePicker in my app suddenly decided that epoch was three days later than it should be:


schedTimePicker = new DateTimePicker();


connect(schedTimePicker, SIGNAL(valueChanged(QDateTime)), this, SLOT(onSchedTimeValueChanged(QDateTime)));


In the slot I have:

void MainClass:: onSchedTimeValueChanged(QDateTime time)


    fprintf(stderr, "%s:%d time=%s\n", __FUNCTION__, __LINE__, time.toString().toUtf8().constData());



When I set the time picker to 00:00:00 the output on the console is:

onSchedTimeValueChanged:5448 time=Sat Jan 3 00:00:00 1970


A full three days after actual epoch. Am I losing it? What's going on?



Posts: 76
Registered: ‎02-08-2013
My Device: z10
My Carrier: rogers

Re: DateTimePicker Confused about Epoch?

Apparently the parameter provided for the valueChanged slot is not what the documentation says it is.


The most reliable way of determining what the value changed _to_ when the slot is called is to look at the picker->value() value instead. I'm suspecting the parameter had the value that was previously set, or something along those lines.