Unable to DateTimePicker getDateTime()

I'm DateTimePicker select Date and time and when I press the ok button to Date time using getDateTime() and assigning him to the calendar object (selectedDate). I want to display the time in the format (fri apr 27 06:00).

So I use code below for formatting.

selectedDate = datePicker.getDateTime ();

SimpleDateFormat sdf = new SimpleDateFormat ("EEE MMM dd hh: mm: aa");    timeField.setText (sdf.formatLocal (selectedDate.get (Calendar.MILLISECOND)));

Don't know if it's an analysis error or DateTimePicker returning at the wrong time, but the display text for any date time select is Thu Jan 01 05:00. As I target most of the devices, my application targeting OS5 and tests on Simulator 9550.

Thank you.

Sorry, I could have solved this right from the start if I read correctly your problem!

I changed two things in your code, well 3 really.  Here's the old code:

selectedDate = datePicker.getDateTime ();
timeField.setText (sdf.formatLocal (chosenDate
.get (Calendar.MILLISECOND)));

And the replacement code:

datePicker.doModal (); New line
selectedDate = datePicker.getDateTime ();
timeField.setText (sdf.formatLocal (selectedDate.getTime () .getTime ()));

chosenDate.get (Calendar.MILLISECOND)?

Things I changed were:

(1) added the doModal so DateTimePicker was posted

(2) changed to selectedDate chosenDate

(3) instead of asking the selectedDate property to provide the number of milliseconds together, I asked for his time selectedDate property UTC in milliseconds.  I'm sure that's what you thought you were doing, but check the documentation to see what you were actually doing.

Now the DateTimePicker actually displays and you can press OK.  However, it does not change the date time and apparently not increment at 15 minute intervals, so I suspect there is a problem with the settings of the DateTimePicker, but I'll let you sort that out.

Tags: BlackBerry Developers

Similar Questions

  • updated Mac and now I am unable to answer the phone calls of the Mac

    Yesterday I updated my Mac to the new operating system.  Since then, I could not pick up calls from the Mac as I used to.

    Can someone tell me how to solve this problem?

    Hi jlfrisella!

    I see that you are unable to use the calls feature cell phones iPhone on your Mac since the update to Mac OS Sierra.  I can understand wanting this function runs on the right, and I'm happy to help you.  Please see requirements and instructions in the following articles.

    Continuity of use to connect your Mac, iPhone, iPad, iPod touch and Apple Watch

    Thank you for using communities of Apple Support.

    See you soon!

  • I have several new emails in the Inbox, but I'm unable to view or even see them?

    I have several new emails in the Inbox, but I'm unable to view or even see them?

    Hey CRB123,

    Thank you for being a part of the communities of Apple Support.

    If I understand your message, you see a badge that you have unread e-mails in your Inbox, but they are not appearing.  An easy way to separate the emails read from the unread macOS that Sierra is to click the button to filter in the list of messages, or sort by unread:

    • Activate the filters: Click the filter button at the top of the list of messages, click unread to display the list of available filters, and then select one or more filters. A check mark indicates a filter is active.

      If you use more than one email account in Mail, you can filter the Inbox into account - for example, only show emails from your iCloud account.

    • Disable an active filter: Click on the filter.

    • Disable all filters: Click the filter button .

      Mail remembers your filters and automatically applied the next time that you click the filter button to activate the filters.

    You can also sort the list of messages - just click on "sort by" at the top of the list of messages, then select an attribute, such as and a sort order. In a typical configuration, click on a column header.

    Mail for Mac: filter the list of messages in Mail

    If no unread messages, then I would like to confirm if you have emails unread looking webmail for your email account. If you see the unread messages in webmail, go back to the mail app, and then rebuild your Inbox:

    You may have to re-create a mailbox to update the list of the messages it contains. For example, if messages seem to be missing or garbled, or if you don't find any relevant messages when you search by using the entire Message search option.

    • Select a mailbox in the Mail sidebar, then choose BALL > rebuild.

    When you rebuild the mailbox for accountIMAP or Exchange messages and attachments stored on your computer are discarded and then downloaded again from the mail server to your Mac. Your mailbox is empty until the download is complete.

    Mail for Mac: rebuild the mailboxes

    Take care.

  • Update for Sierra and now my Apple music does not appear I have a subscription and I am unable to get my music on the cloud?

    Update for Sierra and now my Apple music does not appear I have a subscription and I am unable to get my music on the cloud?

    Hey there Scotchman2926,

    I understand that you are experiencing some problems with Apple music on Sierra. I have a few suggestions to help you solve this problem. First of all, if you are unable to access the iTunes Store as well as music from Apple, use the information in this article to help resolve this problem:

    If you cannot connect to the iTunes Store - Apple Support

    If this does not resolve the problem, you might try signing out of your Apple ID in iTunes and then connect again.

    Thanks to be come to the communities of Apple Support and let us know how it goes.

    See you soon.

  • My 5s iphone suddenly showed no service, then I made an attempt to update to ios and itunes connected, now iphone is not enable and display cannot connect to the server and in itunes it shows unable to check your device.please help me

    My 5s iphone suddenly showed no service, then I made an attempt to update to ios and itunes connected, now iphone is not enable and display cannot connect to the server and in itunes it shows unable to check your device.please help me

    Assuming that you have a valid SIM card in the phone, it is more often symptomatic of a phone that has been hacked or jailbroken to unlock.

    Where do you have the phone first?

  • Unable to select the file in the dialog box in the Sierra

    I'm unable to select an image file in the "save for Web" in the finder window "save under" in Photoshop CC running on the Sierra.

    There are times where I need to save a new image using a similar name by selecting the existing file, which matches the name in the dialog box "save under".

    The use of Photoshop CC in Sierra I am unable to do so due to the inability to select the existing files in the Save-as the finder window.

    I thought at first that was Adobe, but later, I noticed that I can not save for web browsers and other programs. I installed the beta updates on Sierra, but also which did not set. I hope be fixed so I can move on to Sierra. It was not such a problem in previous versions.

    Unfortunately, your discovery is correct. I just met for the first time. I was shocked, but apparently it will work in list view. View miniature not a reason any.

  • Unable to connect to app store after iOS iphone 10 6 update

    Hello

    Since the upgrade to IOS 10 my iPhone 6 with stubbornly refuses to connect to the App store. The error message is "unable to connect to the app store, try again."

    The phone is connected to the internet (I can surf and send emails) by wifi. Turn off the wifi and the use of mobile (cellular) only link cause the same error. I also did a reboot hot and cold, without result.

    Any suggestions?

    Thank you

    Bill...

    ANSWER: this theme has the best 3 options. In my case, I had to sign out and in the app store of settings, iTunes and app store. Fixed

    PLE-3598048 http://www.Macworld.co.uk/How-to/iPhone/What-do-If-You-cant-connect-App-Store-AP.

  • Unable to get airplay to connect to my receiver to my PC.

    Unable to get airplay to connect to my receiver.

    Are both the iOS device and Apple TV on the same wireless network?

    All devices receive their network via DHCP configuration?

    Is insulation wireless disabled on the router, at least for the channel that these devices use?

    Have you tried to reboot all devices including the router first?

    TT2

  • Just updated to IOS 10.0.2 and unable to connect using Store.Please App!

    Just updated to IOS 10.0.2 and unable to connect using Store.Please App!

    Harry

    Hello

    Go down to itunes apple ID page homepage remove ID, then reconnect again.

    See you soon

    Brian

  • Unable to start safe on iMac16, 2

    I am on Mac OS X 10.11.6 on my iMac16, 2 and was trying to startup and to experiment in this mode to determine why I can't see my external drive and why it won't backup using Time Machine.  After the reboot and try to start safe, I discovered that I was unable to get to the start.  I could not, therefore, to get the disk utility to try to use the first aid in its normal mode.  When I used the Warrior drive, everything seems OK, but to be sure, I rebuilt my hard drive also.   Which doesn't seem to change anything.  So I can't use a secure boot and can't see my external hard drive (LaCie d2 Quadro) and cannot perform a backup Time Machine accordingly.  Help.

    You have the same question when we unplug the Lacie?

    You have drive merger?

    You can open a session with a guest account?

  • Unable to play Elton John AMF10 on Apple TV

    All the morning

    For some reason, I am unable to play Elton John AMF10 on the new Apple TV.  Everyone knows this.  Other shows work, but Elton John doesn't.

    I have a sub of Apple's music, and it works in my iTunes on my Mac, the iPhone and the iPad, but not on my Apple TV.

    Hi narly101,

    Thank you for using communities of Apple Support. From what you have said, it seems that you are able to view the performance on other devices.
    Because it is related to the AppleTV, there are a few things that we can try to get this performance to play.

    Update the software on your Apple TV - Apple Support

    Once you try again after the update, or if there is no update to do, so go ahead and restart your Apple TV:

    How to restart your Apple TV

    If the problem persists you can consider restoring the AppleTV to factory settings.

    Restore your Apple TV to its factory settings - Apple Support

    Other performance being able to play, it may be isolated to this one show. If this is the case, you are able to report the concern in the menu video performance.

    Another option because it works on other devices is AirPlay from the computer to the AppleTV.
    Use AirPlay to stream content from iTunes on your computer - Apple Support

    See you soon.

  • I have iOS 10 and I am still unable to make messages with animation effects. How can I solve this problem?

    I have iOS 10 and I am still unable to make messages with animation effects. How can I solve this problem?

    Without knowing what is happening when you try, it is difficult to recommend troubleshooting. However, one of the first steps is to ensure that you don't have to reduce the Motion activated in accessibility.

  • Unable to connect on the Messages or FaceTime after upgrading to Sierra

    Good afternoon! After upgrading my MacBook Pro (13-inch, mid 2010) to macOS Sierra (10.12.), I am unable to connect to Messages or FaceTime. They worked fine before the upgrade.

    • Messages: After entering my Apple ID and password, I get the message "Could not sign in iMessage." "Could not sign. Please check your network connection and try again. "or"an error has occurred during authentication. "My network is connected to the network (where this message), and the password is correct. Also, I have generated a password app specific to Messages. Enter just grew the message "your Apple ID or the password is incorrect." Messages is works well with my Google Talk and AIM accounts.
    • FaceTime: After entering my Apple ID and password, the engine just turns and it never connects me. Similarly, I have generated a password app specific but use it just gets the message, "your Apple ID or the password is incorrect."

    No idea how I can regain access to these applications? Thank you!

    Reached out to the Twitter account of Apple Support. He proposed to restart. It worked.

  • Vodafone carrier in my new iphone 7, unable to show vodafone carrier in my new iphone 7

    HI, I am unable to see Vodafone carrier IPhone 7 parameters. Help, please.

    Thank you

    RAM

    What you're trying to do with the carrier settings?

    You have acquired an iPhone to a different carrier/countries may

    So yes some networks need to send you some of the definition of the parameters via a command text for update functions correctly.

    This included MMS/SMS as much as they are not functions of SIM card.

    Suggest that contact Vodafone in your location.

  • Why the iphone 4 is unable to update version? Latest version 7.1.2

    Why the iphone 4 is unable to update version? Latest version 7.1.2

    because the material is too slow

Maybe you are looking for

  • Cannot use software of regonition of face

    Hello! I hope someone could help me... my laptop is new and I bought him and I want to use face recognition, but the error message said: I have no right... I need to contact my administrator? I'm the admin! I even started the program with admin right

  • software for digital camera Powershot sx150

    This is a delicate and perhaps naïve one. My mother has recently bought digital camera above and was absolutely thrilled with it.  Unfortunately, she died a few weeks ago.  She lived in America; I live in England.  Before dying, she gave me her camer

  • WWW_AUTH_REQUIRED

    About once a week, all users receive WWW_AUTH_REQUIRED notifications and cannot access to internet sites.  URL: It adds http://ironportdevice to the front. The problem is solved for awhile after restarting of had it.  Reported in IE and Firefox.  I'v

  • GoogleMap add unlimited marker

    HelloPlease help I used googlemap jquery libraries to add markers, but I noticed that it only shows the markers up to 11.Joseph

  • I have created a new digital signature for my boss

    Hi allI have created a new digital signature for my boss and then I went through the process and create a password and repeated and then I clicked on finish but then when I try to sign a document, it says that my password is incorrect which I know it