List of contacts an unexpected behavior. Help, please!

Hi guys,.
I'm having a little problem with pulling down the contact information from the address book (including date of birth).
Every time I pull the contact information, date of birth comes back corrupted. I wrote a small test program to illustrate.

I use JRE 5.0.0.14 and 9700 with OS 5.0.0.334 Simulator

public TestAppScreen()
{
call the constructor of the screen
Super();
    
Name of string [];
long date of birth = 0;
SimpleDateFormat sdFormat;
Contact list list = null;
List of contacts contacts = null;
Calendar myCalender = Calendar.GetInstance ();
           
myCalender.set (Calendar.YEAR, 1982);
myCalender.set (Calendar.MONTH, Calendar.NOVEMBER);
myCalender.set (Calendar.DAY_OF_MONTH, 15);
        
Add a new contact to the address book
try {}
contacts = (ContactList) PIM.getInstance () .openPIMList (PIM. CONTACT_LIST, PIM. READ_WRITE);
} catch (PIMException e) {}
System.out.println (e.getMessage ());
}
Contact = contacts.createContact ();
name = String [new contacts.stringArraySize (Contact.NAME)];
name [contact.NAME_GIVEN] = "SomeFirstName";
name [contact.NAME_FAMILY] = "SomeLastName";
contact.addDate (Contact.BIRTHDAY, Contact.ATTR_NONE, myCalender.getTime () .getTime ());

try {}
(contacts.importContact (contact)) .commit ();
} catch (PIMException e) {}
System.out.println (e.getMessage ());
}

Retrieve the contact
try {}
list = (ContactList) PIM.getInstance () .openPIMList (PIM. CONTACT_LIST, PIM. READ_ONLY);
Enumeration contactEnum = list.items ();
{while (contactEnum.hasMoreElements ())}
Contact contactTemp = (Contact) contactEnum.nextElement ();
name = (contactTemp.getStringArray (Contact.NAME, 0));
Date of birth = contactTemp.getDate (Contact.BIRTHDAY, 0);
}
} catch (Exception e) {}
System.out.println (e.getMessage ());
}
        
sdFormat = new SimpleDateFormat ("MMM DD, yyyy hh." "") "'SSS');

Add (new RichTextField ("name:" + name [Contact.NAME_GIVEN] + "" + name [Contact.NAME_FAMILY]));
Add (new RichTextField ("birth date:"+ sdFormat.formatLocal (birthdate) '));
Add (new RichTextField ("originalCalInMillisec:" + myCalender.getTime () .getTime ()));
Add (new RichTextField ("birthdateCalInMillisec:" + date of birth));
}

Here is my result:

name: SomeFirstName SomeLastName

Date of birth: 14 November 1982 19:00:00.000

originalCalInMillisec: 406227608000

birthdateCalInMillisec: 406166400000

Date of birth is wrong

Am I missing something? I'm about to pull out my hair.

Any help would be greatly appreciated.

What is the difference between the time that you set, and what you got back?

If it's basically the difference between the hour GMT (time zone 0) and your time zone (GMT - 6 hours where I am, for example), then it is probably a problem with the time zones.

I ran into the issue before the implementation of the RIM of the PIM database.  You book a date, and then bring it back, and it is now offset by the time zone difference.

Seems to me that you have a difference of 5 hours, which would be time GMT-5 or right side?

Here is an excerpt of code that we use to set the date for the PIM mess.

    public long localTimeAdjust(long date)
    {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date(date));

        TimeZone zone = TimeZone.getDefault();

        int offset = zone.getOffset(1, // AD
                                    cal.get(Calendar.YEAR),
                                    cal.get(Calendar.MONTH),
                                    cal.get(Calendar.DAY_OF_MONTH),
                                    cal.get(Calendar.DAY_OF_WEEK),
                                    cal.get(Calendar.MILLISECOND));

        return offset;

    }

Tags: BlackBerry Developers

Similar Questions

  • I upgrades the operating system of my mac to OSX 10.9.4 and now my Dreamweaver CS5 does not work, it just that closes unexpectedly.  Help, please.

    I upgrades the operating system of my mac to OSX 10.9.4 and now my Dreamweaver CS5 does not work, it just that closes unexpectedly.  Help, please.

    It turns out that my video card is the cause. I removed the accidents stopped and he

  • All 4 printers have disappeared from the list of printers & faxes; reason & need help please!

    Good day to all! (I hope yours goes better mine has)

    When you try to access my internet postage program, I got a message that it was unable to initialize the printer.  When I checked the list of Printers and faxes in Control Panel... I find 4 all printers who WERE there yesterday... are now gone.

    (This excerpt shown below is extracted from the Microsoft support page & described EXACTLY my problem)

    • When you click Startand then click Printers and faxes to try to view your printers, no printers appear. This problem may occur even if you have a printer installed.
    • When you click Add a printer, or when you try to print, you may receive the following error message and cannot add a printer:
    "Operation could not be performed.  Printer Spooler service is not running.

    I tried several times to use "Fix - it" Microsoft online service, and he could not solve the problem.  I just kep saying me he couldn't solve the problem.  It is absolutely No. MS supports available unless you have at least $59.00 or more to pay for trying to help!  "Terminal" and valid on a model of disability very limnited former fighters from one month to the other... I could not certainly not even begin to afford no paid... help unfortunately.

    I am NOT computer saavy and I don't any idea as well WHERE to start... much less HOW to solve this problem!  Unless I can get this printer spooler service, or something else... running... I can't even begin to try to re - install a printer I have.

    I would greatly appreciate any help anyone can offer!  I'm at the end of my tether here!  Thank you very much for your time and review!

    Pete C.

    For the moment, I'm inclined to let my "sleepine XP 'dog' lie'... Since things seem to work almost normal again.

    Good plan.

  • Contact Page and PHP: help, please.

    I created a page of contact within Flash using the following actionscript code:
    Stop();

    var senderLoad: LoadVars = new LoadVars();
    var receiveLoad: LoadVars = new LoadVars();

    sender.onRelease = function() {}
    senderLoad.theName = theName.text;
    senderLoad.theEmail = theEmail.text;
    senderLoad.theAddress = theAddress.text;
    senderLoad.thePhone = thePhone.text;
    senderLoad.theMessage = theMessage.text;
    senderLoad.sendAndLoad (" http://mydomain.com/mailExample.send.php", receiveLoad, POST);
    }

    And with the next PHP in Dreamweaver:

    <? PHP

    $to = "[email protected]."
    $subject = "sending the form of contact";
    $message = "name:". "." $theName;
    $message = "\nAddress:". "." $theAddress;
    $message = "\nPhone:". "." $thePhone;
    $message. = "\nEmail:". "." $theEmail;
    $message. = "\n\nMessage:". "." $theMessage;
    $headers = "from: [email protected]";
    $headers. = "\nReply-To: $theEmail";

    mail ($to, $Subject, $message, $headers);

    ? >

    My problem is that only phone and e-mail are sent to my to: address. I don't know why, two only entered send while others are not. Any help would be appreciated!

    Thank you
    Aaron

    Amyrs wrote:
    > $message = "name:". "." $theName;
    > $message = "\nAddress:". "." $theAddress;
    > $message = "\nPhone:". "." $thePhone;
    > $message. = "\nEmail:". "." $theEmail;
    > $message. = "\n\nMessage:". "." $theMessage;

    The first three lines above crash the other. You must use
    the combined concatenation operator (. =) for the second and subsequent
    lines.

    --
    David powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • My Creative Cloud CC guard quit unexpectedly. Help, please!

    I can't even run it and see the applications because it blocks 30 seconds after I open it.

    Wippod please update your operating system Mac OS 10.7.5.

  • I use an Apple computer and have an annual package of photography creative cloud. I tried to buy Indesign in addition but was unable to do so. Help, please.

    I have an annual membership of creative cloud for photography. (Photoshop)

    I would like to add Indesign to my package.

    When I tried to buy it I got a message "you have a problem with your purchase please contact support.

    Help, please.

    Ian.

    I use an Apple laptop (2014) with Mac OS (10.9.5)

    For questions of purchase, you will need to communicate directly with the Support from Adobe.

    Chat support - the link below click the still need help? the option in the blue box below and choose the option to chat...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )

  • BlackBerry smartphones help please! Used to synchronize my contacts list.

    Hi I have to blackberrys curve time and I wanted to switch to the other, but when I tried to send contacts to microsoft outlook to transfer to the second blackberry and also save on my destop but instead it cuts contacts in two and put the same name of list of contacts for the two and one of them cannot synchronize and I tried different things as backup to remove and reinstall but nothing works because I can't save what can not be recognized for synchronized any ideads?

    There are several different KBs which can cope with situations similar to yours; I recommend you try the KB database search, using a variety of search terms (for example, "lists of duplicate contacts", "lists of contacts of fusion", etc.) to see if you can find a knockout that takes into account your specific circumstances:

    Good luck!

  • Hey, I don't see my friends on Apple Watch contact? help please.

    Hey, I don't see my friends on Apple Watch contact? help please.

    on the digital touch and should add the address of my friend

    HI - try the following steps.

    After the Association Apple Watch with an iPhone, you may have to wait an hour or more before you can receive a digital key.

    Otherwise, this checklist is intended to address potential problems, which can also help to solve or to avoid other problems.

    • In the Contacts application on your iPhone:
      • Make sure the contact of each friend card contains their iPhone phone number and email address Apple ID.
      • Check that your contact card contains your Apple ID email address and your iPhone number.
    • On your iPhone, go to: settings > Mail, Contacts, calendar > in the Contacts section, check my Info using your contact card.
    • On your iPhone, go to: settings > general > Siri > My Info - make sure your contact card is selected.
    • Check that you have added each of your friends to the friends list on your Apple Watch:
      • On your iPhone, in the application of the Watch: Watch My > friends.
      • To add more friends: friends list > add friend > tap someone in the contacts list.
      • If someone is not in the list, open the Contacts on your iPhone, add them here, and then try again.
    • Remove the old iMessage conversations with each of your friends on your iPhone and Apple Watch:
      • iPhone: app Messages > swipe to the left on a message thread > delete.
      • View: Open the Messages app (from the home screen, which is accessible by pressing the digital Crown) > swipe to the left on a message thread > tap on Trash / delete.
    • Set new conversations of Messages from your iPhone phone number:
      • iPhone: settings > Messages > Send and receive > scroll to start new Conversations of > choose your iPhone phone number.
    • Check the email addresses to which you can be reached via iMessage:
      • iPhone: settings > Messages > Send and receive > under you are reachable by iMessage to > allow email address Apple ID (with a scale) (do not enable others who are not only yours).
    • On your iPhone in the app Watch: Watch My > general > reset > press reset sync data:
      • You won't see anything happen after pressing it (the process runs in the background, invisible to the user).
      • Wait a minute or so (to allow contacts to be erased and replaced on your watch).
    • Disable and re-enable iMessage on your iPhone:
      • iPhone > settings > iMessage > enable/disable / enable again.
    • Restart your iPhone and your watch (turn the two together off the coast, then restart your iPhone first):
      • To turn off your watch: press and hold the button side until you see the cursor off the power; slide it to turn off. To restart: press and hold the side button until you see the logo.

    Also ask your friends to follow equivalent process.

    More information:

    Use the touch-Apple Support

  • Help, please! Lost contacts.

    Somehow in the past few days I lost some of my contacts that I have / text of the call all the time.

    I tried to restart taking the sim card and the battery several times and lost contacts have not been restored.

    I went to my GMail account to see if the contacts were in this list and they weren't which was also strange.

    Help, please!

    When you view your google contacts, there is more then one place to look - on pc - category wise.

    New contacts appear to be under 'other contacts' at the bottom of the list on the left and not under "my contacts".

  • BBM my camera was stolen and I want to backup my list BBM contact please

    I am Mohammed Al Anazi from Saudi Arabia and I Aprociate your help on my bbm phone who stole before 3 days, I lost my phone and bbm contacts list and I need my list to get back again to my new phone I buy new, I have account with protection blackberry but whene I did backup I received the wrong note and some of my information in old man who was in my phone which is stolen but my BBM surveys list backup because of the old update, I have all my reversal original in my old blackberry phone if you can return my old bbm list numbers I enjoy you to help me please because I need as soon as possible all my friends are whith my old bbm messenger
     
    My old bbm number is {DELETED} I also have all my personal information and phone number if you need
     
    My new BBM IS {DELETED}
    Best regards

    MOD Edit: Edited post to remove the personal information in accordance with the Community guidelines and the terms and Conditions of use

    If you have BBM v7 or newer contacts BBM are saved with your BlackBerry ID and you need only memory in BBM with your new device. If you have a v6 or older then they would be stored in your backup with Desktop software.

  • When trying to access the tab elements of remuneration for work of the buyer to get the error you encountered an unexpected error. Please contact the system administrator for assistance.

    When you try to access the tab to pay the buyer work center items get error:

    You have encountered an unexpected error. Please contact the system administrator for assistance. (Without any additional information)

    Please need help on how to solve this problem.

    Thank you

    Rambeau

    It seems bug-

    Please see - Center of the buyer: make an Exception when clicking on PAY tab ELEMENTS (Doc ID 1993378.1)

    Kind regards

    Kiran

  • Bookmarks are missing from the list tab so much my favorite and I do not know if this was caused by the plugin or due to lack of space in my internal HD. Help, please?

    Dear community, I promise that I will try to be as concise as possible. I am really desperate for help! I read absolutely everything about missing bookmarks, but as you can see my problem also concerns the sliders and Google are different on the screen.

    It all started that day that I was running short on storage in my boarding school HD all of a sudden my computer showed that I had 0 KB available, and I just deleted some big mov files and restarted the computer. After the reboot, I opened FF and noticed that my favorites were missing and so has my reading list - my reading list is stored using the ReadItLater plugin (https://addons.mozilla.org/en-US/firefox/addon/read-it-later/). I tried to google solutions for my problem and realized that something was strange the way the results have been posted.

    So, I made some screenshots because it's really hard to explain what happens in writing, so please take a look:

    1. when I first open my FF, if I click on ReadItLater, I get this error message (code 0 x 80570016): [[click here | http://www.flickr.com/photos/81007892@N07/7423869970/]]

    2. then if I click any link on the page and go back to check my ReadItLater list, I can open it without receiving an error message, but always WITHOUT READING LIST is displayed. Image: [[click here | http://flic.kr/p/cj2gPm]]

    3. now take a look at how Google is the display of the results on FF! The text appears in black/green when it is really supposed to be displayed in blue/green/black! The cursor is also messed up: when I try to click on one of the links with the arrow, it turns into a cursor type instead of the usual hand or by clicking on the slider! Please see the image: [[click here | http://www.flickr.com/photos/81007892@N07/7423869468/]]

    4. here is a screenshot of the same search Google but this time made the Safari. Compare it with the previous image: [[click here | http://www.flickr.com/photos/81007892@N07/7423869252/]]

    Any help will be much appreciated. I tried to reinstall FF again once already and I also deleted and reinstalled FF but I never deleted personal profile which is located in the library folder information. In addition, tried to back up and replace the profile folder but my computer does not allow me. I received a message saying that it was not possible to copy the file places.sqlite - wal. I did a search on this subject and I can say that I never had a double profile. Help, please? I'm desperate and I can't lose my playlist of my favorites!

    Thank you, community of Firefox!

    Hello

    Please see this.

  • Can anyone help please? I think of web page has changed all of a sudden. Everything is listed on the left side of the screen and appears to be in a basic format.

    Can anyone help please? I think of web page has changed all of a sudden. Everything is listed on the left side of the screen and appears to be in a basic format. I run XP and use Firefox 9.0.1.
    Thank you...

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • you just bought an iPhone6. My contacts were transferred a manager of T-Mobile Samsung Galaxy 6 mt. I can't find them on the new phone. Help, please! Thank you.

    you just bought an iPhone6. My contacts were transferred a manager of T-Mobile Samsung Galaxy 6 mt. I can't find them on the new phone. Help, please! Thank you.

    You still have your old phone?

    Were your contacts on email like Outlook or Gmail?

    Switch from Android to iPhone, iPad, or iPod touch - Apple Support

  • Stop: c000021a {(erreur système fatale) stop: c000021a.} Windows logon process system ended unexpectedly with the status of 0xc0000080(0x00000000) (0x00000000) system has been arrested. Help, please.

    Unrecoverable system error, stop: c000021a. Logon windows system process finished in unexpected ways with the State 0xc0000080(0x00000000) (0x00000000) system was stopped.
    Technical information
    Stop 0x000000F4 (0 x 00000003, 0 85504088, 0x85504EEC, 0x8095AAOE)
    It is a model of MSI U135DX MS N014 laptop, Windows xp home edition and have a cd player.
    Help please... Thank U.

    Triple LOL.

    You have no idea... you.

    Try your advice.

Maybe you are looking for