Problem with SimepleDateFormat for the military pattern....

i have the code, which has to display date in the military format i.e., "yyyyMMddhhmm".
java.util.Date date = new SimpleDateFormat("yyyyMMddhhmm").parse("200709201700");
System.out.println("Expected Date : " + date);
but output displays everytime i.e., Thu Sep 20 17:00:00 IST 2007
is there any problem with the pattern???

By military format you mean 24 hour clock time, right? I believe "hh" in SimpleDateFormat is for 12 hour clock time and "HH" is for 2 digits of 24 hour clock time.
EDIT: Also, you're just parsing the string into a Date object. When you're printing, it'll simply use the toString() for Date, giving you an output as you see. If you want the output also to be formatted in the same way, you need to use the format() method of SimpleDateFormat with the same pattern on the Date.
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
(Yes I know it's on JavaRanch but I think it applies everywhere)
Edited by: nogoodatcoding on Oct 3, 2007 6:03 PM

Similar Messages

  • I'm having problems with Outlook for the Mac, anyone else?, I'm having problems with Outlook for the Mac, anyone else?

    I have recently purchased a Mac.  I'm very dissapointed at the way Outlook 2011(the newest version, what?!?)interfaces with the Mac.  I used the contacts feature all the time when I had a microsoft system.  Now, I can't do that with Outlook for the Mac.  Does anyone have any alternative Apps that they've used for Business contacts?  Thanks much.

    thank you both for your responses.  I'm having trouble mostly with a way to handle my business contacts. I'm self employed and when I had Outlook for Microst(before I switched to Apple)I was so pleased with this softward. Esp the way it would keep track of any correspondense between me and my customer.  I could also track billing thru Outlook contacts. 
    Now, I get my mail thru outllook and use ical and @contacts.  I see that I can have a separate group of contacts thru @contacts, but, it's not the same or nearly as good as Outlook contacts for Microsoft.
    So, right now I'm really disapointed with my Mac purchase and hoping to find an app that will help.  I will investigate Thunderbird.
    thanks again.

  • Problem with iTunes for the mac

    1. I can only see a small portion of the bar at the top. All of the buttons look messed up. I reinstalled but it didn't help.
    2. the music section only shows a small portion of the songs in my library  When I turn on the share option it shows all of the songs but most of them are in the cloud and it won't let me transfer any of them to my iPod nano.
    3. How do I take all the songs out of the cloud and put them all back on my computer? when I turn off share it only shows the songs that are not in the cloud.
    thanks I am using a new imac

    You can't track your iPod through iTunes. If you enabled 'Find my iPod' then you can look for it from the iCloud website using your apple ID.

  • Problem with checking for the tab bayte '09' in a string in WAS 7.0

    Hi
    I use to have a small program that I have used on several occasion that could generate the menu structures for my roles, based on an excel spreadsheet.
    But somehow it doesn't work on WAS 7.0
    In the line :
        check excelt-line cn tab.
    I get the error message
    TAB must be a character-type data object (data type C, N, D, T or String)
    Tab is defined like this
    tab type x value '09',
    , the byte '09' used for separating the columns in the spreadsheet.
    And excelt is defined like this
      begin of excelt occurs 200,
        line(256),
      end of excelt,
    Do any of you ABAP Guru's have any hint on how to solve this
    Regards
    Morten Nielsen

    Hi ,
          In the program add the following code.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    CONSTANTS:
    tab TYPE c VALUE cl_abap_char_utilities=>minchar.
    Please reward if useful.

  • Updated to new firefox 5-now get error can't initialize the apps security component won't display websites-using AVG11-used firefox help file to allow fire.exe to run, & restrted by still no go-first update i've had problems with, thanks for the help

    see above

    Probably you could start the oracle database with SQLPLUS, and it will output the errors in dialog.
    Eks:
    log on as sidadm:
    sqlplus / as sysdba
    sql> startup
    It will tell you if any table spaces are in recoverymode or offline.
    A better walkthrough can be obtained in my blogpage on similar matters:
    http://shortdump.blogspot.com/2006/12/how-to-recover-damaged-oracle-instance.html

  • I have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

  • Mountain Lion fails to install saying it cannot create the recovery; I had a similar problem with Lion and the Apple Store that helped me resolve it gave me an installable version of Mountain Lion on a flash drive for my inconvenience....

    Mountain Lion fails to install saying it cannot create the recovery; I had a similar problem with Lion and the Apple Store that helped me resolve it gave me an installable version of Mountain Lion on a flash drive for my inconvenience....is there some trick I am missing or do I need to make an appointment with a genius...

    I have the MacIntosh volume and the Boot Camp partition only.  I know that when I installed Lion, I had to go through a whole back-up and recovery of Windows and then re-format the drive. 
    The tech at the Apple Store had a previous life as a MSCE and was very helpful.  I believe he even said that I should not have htis problem with Mountain Lion which is why they gave me the flash with it onboard.  I was in the process of starting a new job when I went to Lion, so I have waited to do this next and probably last upgrade to this old MBP since I doubt Apple will support this MBP in Maverick. 
    I do not have another installation, so that is not an option.  I will try to create an external, I have plenty of hard drives around and see if I can get it done that way.  It might take me a week or two to get back to it, but I will comment back upon completion of that effort.  Thanks for your help....Dave Iverson

  • Is there a fix yet for the no sound problem with lion on the iMac without having to restart every time I switch the computer on?

    Is there a fix yet for the no sound problem with lion on the iMac without having to restart every time I switch the computer on?

    Try booting in Safe Mode by holding the the shift key immediately after powering on your system. Safe boot mode will for a directory check of your startup volume, then load only the required kernal extensions (kext files), and deletes some cache files. Once the system boots into Safe Mode you can simply restart the system to see whether the issue has been resolved.
    If you still have the issue try resetting the SMC by shutting down the system and disconnecting the power cord for ~15 seconds, then reconnecting the power cord. Next, reset the parameter RAM (PRAM) by holding down the option-option-P-R keys after powering ON the system. Wait until the iMac restarts twice, then let the system boot normally.

  • If i buy an apple product from the actual customer who bought it, and i face some problem with it, but the device is still under warranty, so would there be any issue for getting the device checked?

    If i buy an apple product from the actual customer who bought it, and i face some problem with it, but the device is still under warranty, so would there be any issue for getting the device checked?

    If you make an appointment at the Genius Bar about a problem, they will check and evaluate the device, and if it warrants a replacement under warranty, they make the final determination. We are users here. This is a user to user support forum. We cannot determine what Apple will do. I can tell you what I already did, the warranty follows the device.

  • We have been having a problem with newsletters for a client. The newsletter works fine except if we add a button and/or link to the top zone on that newsletter it blows up ONLY ON iPhones!

    We have been having a problem with newsletters for a client.
    The newsletter works fine except if we add a button and/or link to the top zone on that newsletter it blows up ONLY ON iPhones!
    This happened last month too. It seems to be related to length of the newsletter too. It works on every device except iPhones - so weird.

    Hi, is anyone else experiencing i-phone only problems on email campaigns? not bashing Apple, just having issues where our newsletter are only having issues on iPhones

  • Error-1074396120 Not an image, problem with IMAQ Learn multiple geometric patterns

    Error-1074396120 Not an image, problem with IMAQ Learn multiple geometric patterns
    Hi!
    I've tried to modify the example of  "multiple geometric patterns matching" , and just use two patterns, but when I run the VI this error appear and I doon't know how to solve it! , the error appears in the "IMAQ Learn multiple geometric patterns" block.
    Running on:
    - labview 32 bits
    - windows 7 64 bits
    - usb camera 2.0
    Any sugestion would be helpful..... !  Regards
    Attachments:
    template_12.png ‏150 KB
    template_11.png ‏123 KB
    vision_multiple_pattern_matching.vi ‏127 KB

    thanks all for your replies, the problem was on my template images, I had to give them information about the pattern matching, and I did it with NI Vision Template Editor, within Vision utilities, and I chose template with Feature Based. 
    Thank you again and Regards!

  • Problem with Pages on the iPad 2.

    Hi all,
    I have been having a strange problem with Pages on the iPad that I hope someone can find a solution for.
    As a writer, I find that Pages on the iPad is a very good solution to my problem of needing something small and light to transport around, whilst still allowing me to do some serious writing.  I use the Apple 3 battery bluetooth keyboard, and this gives me a superb working solution.
    I started using the iPad 2 to do my second book and for the first 40,000 words everything was fine.  But as I started going back and forth with the cursor keys, editing passages in the book, I noticed that the cursor position did not match up with the I beam cursor on screen.  As it transitioned between pages it would loose it's corresponding position and the entry point for new text could be up to six characters in either direction.
    Now this is not a problem if you enter a new page, as there is nothing beyond it, but in the majority of cases it is a major problem when going back over your work and editing it.  I have to manually reset the start position of every new page so as to garantee the typing will go where I want it to.
    Now I thought at first this was something to do with Bluetooth keyboard, but after using the onscreen keyboard and the find and replace function, I have noticed that it loses it's position in the document in a similar way.  I have included a screen shot of it finding a problem I was searching for.  In this case it is ", and" to be replaced with "and," or "and".  Clearly in the image you can see that it is not happy and is not selecting the right things, if I replace it will replace exactly what is selected.
    Has anyone else seen this problem.  It seems to happen with large or small documents and I think that this is a fundamental problem with Pages on the iPad.  Seeing as I can't get Apple to acknowledge this I brought it here for everyone else to check out.  If we get enough voices on this, then we can make change happen.

    That's right Br Abdullah, I'm finding the same problem with my itune Arabic library that I synced to iBooks version 1.5! As you say the pages are not arranged correctly.
    The other problem that I'm finding is that the highlights & notes that i have made on the books on a previous version of ibooks, when synced with ibooks version 1.5, they are scattered everywhere, and sometimes in areas where there are no texts.
    I left a message on the report a bug section of iBooks on the app store, and I contacted them on their feedback of apple product issues. I don't know what else we can do. It seems that no one is listening to us. I'm Dissapointed that I upgraded my iBooks version to 1.5; I was really looking forward to reading on my new iPhone 4S (on iBooks)!
    What else can we do to get our concerns heared? Somebody? Anybody?

  • Problem with mail for exchange after update on E72...

    Hi everyone,
      I updated Nokia E-mail to ver 3.9 on E72. Now I am facing  a problem with mail for exchange. I have configured gmail on mail for exchange. I recieve a warning that "unable to sync contact administrator if problem persist". It started to pop up just after the update was over and is very frustrating. Even previously i used to recieve mails instantly but now it generally takes half an hour for me to recieve them. I deleted and created mail for exchange several times but to no avail.
    Also i am not able to automatically recieve mails other emails which i have configured. every time I have to manually download them everytime.
    Can anybody suggest a way out.
    Thanks
    Anil

    It could be a problem if you're using your network's connections...
    I was on a Pay & Go tariff with o2 some time ago, and needed secure connections for various things, o2 told me they didn't provide secure connections on Pay & Go tariffs...
    Could be worth checking with them to make sure it's supported.
    Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
    Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5

  • Problem with facetime for mac

    hello guy! I've got a problem with facetime for mac.My sister has a I-pod touch fourth generation with factime but i cna't phone her a message come on my mac.It say "xxx can't receive facetime's calls"!Can you help me??

    Thanks, Dah•veed.
    I did see mention of using Google Public DNS while I was searching the forums prior to posting, but to be honest didn't think it was a DNS-related problem.
    However, to rule it out I've set the prefered DNS servers on my router to Google's, but FaceTime still disconnects after 4-5 seconds when calling between me and my brother-in-law.  It doesn't matter who initiates the call.
    As a test, before I made the changes to my router, I logged into FaceTime as him on my MBP and tried calling myself on my iMac, and that was successful.
    The same test between the two iMacs when they were here was unsuccessful, so now I'm definitely thinking it's something on the '08 iMac.
    Now I just need to figure out what...

  • Problem with Twitter for Mac notifications

    Hello,
    I have a strange problem with Twitter for Mac. On both my home and office Macs. New posts appear in app window but there aren't any notifications even though notifications are set in preferences to show in both dock and menubar. Perhaps anyone noticed similar strange behaviour? I didn't find anything similar on Twitter forums.
    Thanks in advance.

    Solved by
    Dr.AvituvOct 20, 2014 11:09 PM
    go to Terminal and post this:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/support/lsregister -kill -seed
    if it doesn't have that specific directory try this:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed
    once the scanning is done (can be short or long, depends on how heavy your system is) RESTART the computer.
    when you're back, go to Apple>system preferences>extensions.... guess who's there.
    I hope it helped.
    The Doctor.
    iMac, OS X Yosemite (10.10)
    To restore Actions extensions for good and other stuff
    THANKS!

Maybe you are looking for

  • Admin Console browser problem

    Hi, This is a peculiar problem that I am facing. I am working with iPS3.0SP3 on solaris8. My installation went fine. But when I try to access Admin console(thru Netscape 4.7 or 4.75), I have the login screen displayed. But, after I provide User and P

  • B2CBasket- Sales Order  How to add Vendor partner and new line item of SO

    Hi, I want to add the following BEFORE the sales order creation process starts: Add a VENDOR partner Add a new line item to ORDERADM_I I suspect in BADI CRM_ISA_BASKET_ITEMS and CRM_ISA_BASKET_HEAD. I have user 'HEAD' to add extension fields but cant

  • SAPXMLTOOLKIT Performance issue on XSLT conversion

    Hi, I am runnning a large XSLT transformation (source XML ~ 16MB - relatively flat format record structure from a POS system converting to IS Retail IDOC WPUBON  IDOC - around5MB of converted XML). The aim is that this is portable bewteen SAP Busines

  • How to create a policy banner in Mountain Lion?

    I maintain quite a few Macs for an enterprise environment.  One of the requirements for our gold image is to have our users agree to our epolicy before login.  In Lion and Snow Leopard you could create a "PolicyBanner.rtf" and place it in /Library/Se

  • Photoshop launching issues

    I just downloaded a rial of Photoshop (for Windows), when launching the program it appears to load up fine, then before I can use it I get a message "A problem caused the program to stop working correctly". I downloaded Illustrator to test if I would