Is there a problem on the pattern of SimpleDateFormat to parse a String ?

Hello,
I tried to parse a String to a Date using a SimpleDateFormat.
I must be able to have on the pattern something like : "yyyyMMdd_HH00".
To get a String from a Date with SimpleDateFormat.format(Date date) it works well, but when a try to parse a String into a Date with SimpleDateFormat.parse(String date) I get a : java.text.ParseException: Unparseable date.
I try it on a JVM 1.4 and 1.5 for the same result.
An exemple of code :
          String pattern = "yyyyMMdd_HH00";
          SimpleDateFormat currentFormat = new SimpleDateFormat(pattern);
          Date date = currentFormat.parse("20091223_1000");It seems that adding the '00' after 'HH' raise the exception...
Has the 'HH00' a particular meaning like on Oracle 'HH24' ?
Is there a way to add number after the 'HH' ?
Thanks
Edit :
Oh yeah, I forgot, I tryied to use the pattern "yyyyMMdd_HH'00'" using '' to escape the 00 without better result...
Edited by: Jeremy.Antonucci on 23 déc. 2009 15:25

The context of this pattern :
To get a file on a http server, I must build an Url String with a filename using the current date.
I want to be able to change easily the pattern on a file parameters.
The date must be ending with 00 for the minutes.
I may have use a pattern with 'HHmm' and suppress the minutes but if it is change on the futur the code will not work...
As I can't say if in the futur the url will change for the date pattern or not, I decide to use a pattern like "yyyyMMdd_HH00" that works fine for everything else than parsing a string.
I create a String date based on the current date on UTC using this pattern and keep it to use it to compose an Url String.
After I need to know how much time I must sleep before the next execution (on each Hour), so I use this date +1 hour to see if the currentDate during this calculation is higher than this date+1... (I'm surely not clear, but it is not the real problem just for curious ^^)
A dirty solution is to avoid this problem is to catch this case and do substitution on a temporary pattern of the 'HH00' with 'HHmm'. It's really dirty because nothing says that later a 'HH00' mean always 'HHmm' but I have nothing better...
          String pattern2 = pattern;
          if (pattern.matches(".*HH00$")) {
               pattern2=pattern.substring(0, (pattern.length()-2))+"mm";
          }Where can I do this bug report ?
Do you see a good solution ?

Similar Messages

  • Is there a problem with the itunes and quick time download pages or is it my internet.

    Is there a problem with the itunes and quicktime download pages or is it just my internet.

    Some more developments ... the issue appears to be browser-specific. I can't see the download controls at the moment in either IE 8 (I'll get your message) or Safari for Windows 5.0.5 (I'll just get the blank box). But I can see the download controls in Firefox 4 and Chrome (whatever version I have of that).
    So it might be worth installing Firefox and seeing if you can get the downloads via that:
    http://www.mozilla.com/en-US/firefox/new/

  • Error message in .docx : 'Open XML file cannot be opened because there are problems with the contents. Details Unspecific error Location: 2'

    I have put a lot of work into a docx document on my Mac, but now can't open it as it gives the error message: 'the Open XML file cannot be opened because there are problems with the contents. Details, Unspecific
    error, Location: 2'
    When opening the original file the message said: 'this file contains word 2007 for Windows equations' etc. but I managed to track changes fine, and saved, closed and re-opened it numerous times without problem. Some graphs seemed moved, and various formulas
    were illegible, but no other weirdness was observed.
    I have microsoft 2008 installed on my Mac OS X version 10.6.8.
    I've tried to fix it using various solutions suggested here, but am afraid am too IT illiterate to have had any luck, please help I'm new to all this!
    I've uploaded it to https://www.dropbox.com/s/hkw9k6lyihzoxpc/SittwayPauktawSQUEACREPORT_KD%2BCH.docx

    Hi,
    This issue is related strictly to oMath tags and occurs when a graphical object or text box is anchored to the same paragraph that contains the equation.
    Please use the "Fix it" tool in the following KB article to resolve the problem. See:
    http://support.microsoft.com/kb/2528942
    Hope this helps.
    Regards,
    Steve Fan
    TechNet Community Support

  • Is there a problem with the latest iTunes update?

    After getting the most recent iTunes update my iPhone is no longer recognized by iTunes. When its connected to my computer it charges but you can't see it on iTunes and none of the content can be accessed. I've never had this problem before, and it doesn't happen on my other computer with an older version of iTunes. I've gone through the troubleshooting suggestions for this on the Apple site but nothing seems to work. Is there a problem with the new update? And will it be getting fixed soon?

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • The file .docx cannot be opened because there are problems with the contents in sharepoint document library

    I created a site and  created a document libarary and assigned a word document as a content type . I have written a workflow to create a new document . The workflow is working fine and all the document is getting created and values are getting stored
    in it .
    As per my requirement I am saving the above site as site template .
    After that I am creating a new site based on the above site template , Its getting created and I started the workflow , its working fine and the document is also getting created .
    The problem is I am getting error while opening the word document
    Error - The file filename.docx cannot be opened because there are problems with the contents .
    Details - No error details availble .
    Indresh

    What are you doing within the txt document?  Is it general text and string based items, or have you something more elaborate going on?
    An older discussion here elaborates a bit more on the dotx vs docx side of things.
    http://social.msdn.microsoft.com/Forums/en-US/de1b5ff9-ea6d-460c-a707-8c28acd4906f/error-opening-office-open-xml-file-when-using-sd-workflow-to-create-item-in-document-library?forum=sharepointcustomizationlegacy
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • When downloading from a Sony minidisc video camera, the picture is downloading but without sound.  Previously, it had downloaded successfully both sound and picture.  I have subsequently upgraded to Lion X (10.7.4).  Is there some problem with the driver?

    When downloading from a Sony minidisc video camera, the picture is downloading but without sound.  Previously, it had downloaded successfully both sound and picture.  I have subsequently upgraded to Lion X (10.7.4).  Is there some problem with the upgrade which is affecting the transfer?  Is there a way of resolving this?

    When you have kernel panics, the pertinent information is in the panic report.
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ System Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar.
    There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of reports. A panic report has a name that begins with "Kernel" and ends in ".panic". Select the most recent one. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    If you don't see any reports listed, but you know there was a panic, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.

  • Is there a problem with the Firefox synch server?

    I have three installations of Firefox 4.0.1 on two machines (two fixed, one PortableApps). They are all set up to synchronise.
    Since yesterday, all are showing an error at the bottom of the window saying "Sync encountered an error while connecting: Server incorrectly configured. Please try again."
    I've made no configuration changes to the synch in the last few days, nor have I updated the Firefox version.
    Is there a problem with the synch server?
    Regards
    Nick

    Firefox Sync - System Status:
    * https://services.mozilla.com/status/

  • OdiWaitForData - ODI-30062: Theres no table matching the pattern in the dat

    I am using the odiwaitforData tool to check for new records in an Oracle table.
    I can view the data for the table from the Model in ODI, as well as execute an interface that uses it.
    But when I execute the odiWaitForData tool to check for data, it throws an ODI-30062: Theres no table matching the pattern in the database error.
    I have tried in several different contexts, and from several different agents - all get the same error.
    I have used odiwaitfordata successfully to get data from an Informix table - but when I try it from the Oracle table it errors out.
    What queries does this tool use to validate its tables? Do they need any unique permissions in Oracle to allow it to work?
    Here's the actual tool command:
    OdiWaitForData "-CONTEXT=DEVELOPMENT" "-GLOBAL_ROWCOUNT=1" "-LSCHEMA=DM" "-POLLINT=6000" "-TIMEOUT=0" "-TIMEOUT_WITH_ROWS_OK=YES" "-INCREMENT_DETECTION=NO" "-TABLE_NAME=ORG_DIM" "-OBJECT_TYPE=T"

    Hi,
    I am new to ODI, but it seems the issue is with table name.
    You may like to try with a table name with no underscore in it.
    I used another table name without underscore, though I got the errors at the last stage, atleast it executed the first step.
    RR
    Edited by: user12048072 on Aug 2, 2011 11:16 PM

  • Cannot open Word File because "there are problems with the contents"

    Hi Everyone,
    I cannot open Word File because "there are problems with the contents" unspecified error; Location: 2.  Please help as I need this doc for work meeting this morning.  Nothing special about this doc but links were copied into it???  However I do that all the time.  I have never had this happen before.  I am on a 2010 machine.  I just ran a disk permissions repaired and emptied the trash but still no dice.  I had several other word docs up as well when I got up this morning but they are all fine.  I do not have Time Capsule turned on (which I need to do but that will be another thread/question).
    Thank you,
    sb

    Ok, I found a way to open this but not sure what happened to begin with and the formatting setup is different now, almost like text editor?  Not sure what happened here but hope it doesn't happen again?

  • HELLO, I HAVE THE SNOW OF LEOAPARD 10.6.8, I WOULD LIKE TO UPDATE THE LAST LION. I WOULD LIKE TO KNOW IF THERE ARE PROBLEMS WITH THE SOFTWARE COMPATIBILITY NOW, EXAMPLES: LOGIC, REASON, SUITE ADOBE CS5 ... THANK YOU

    HELLO, I HAVE THE SNOW LEOAPARD 10.6.8, I WOULD LIKE TO UPDATE THE LAST LION. I WOULD LIKE TO KNOW IF THERE ARE PROBLEMS WITH THE SOFTWARE COMPATIBILITY NOW, (EXAMPLES: LOGIC, REASON, SUITE ADOBE CS5 ...) THANK YOU!

    Have a look here:
    http://applehelpwriter.com/2011/07/24/will-my-old-apps-work-with-lion/
    (Like any website owner, I may (or may not) derive compensation from my website)

  • What's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    What's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    The best cover is the one that suites your needs. Try Google. There are dozens on the market.
    As for the Apple Smart Cover, it does work with the new iPad. There are a few reported issues with it, but that doesn't come close to representing the totality of folks with it.

  • I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?

    I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?
    Many thanks for any advice.
    David

    You don't need conversion programs, iTunes can copy most of your content over to the iPad via the file sharing section, and some apps also support Dropbox, email attachments, transfer via your wifi network. There are a number of apps that you can get that support Microsoft office file (microsoft don't make an app versions of their software) e.g. from Apple there are Pages (word support), Numbers (excel) and Keynote (powerpoint), and from third-parties there are apps such as Documents To Go and QuickOffice HD

  • Last night i downloaded two t.v. shows and it took over 8 hours.  Is there a problem witht the apple server?

    Last night it took 8 hours to download two t.v. show, and today it says it will take 8 hours to download the lastest upgrade to ITunes.  Is there a problem with the apple server?  I am not having problems downloading from any other web site and i have excellent wireless strength and a very fast download servive from Verizon.

    Are you going over Wi-Fi or do you have an ethernet cable plugged in to the ATV?  If ethernet, unplug it and reconnect the ATV using Wi-Fi and re-run the update.  There is a known bug regarding updating the ATV with ethernet, using Wi-Fi fixes it.  I had this problem on my brand new ATV and after searching the web I found this resolution, and it worked.  After the update (which took about 20 minutes total) the ATV rebooted itself, I then shut it down, reconnected with my ethernet cable, and now all is well.

  • Having just bought an iMac and set every thing up I have found that my IPad seems to run very slow. I have also just updated the IPad to OS 5.1 .Are these two things connected or is there a problem with the IPad

    Having just bought an iMac and set every thing up I have found that my IPad seems to run very slow. I have also just updated the IPad to OS 5.1 .Are these two things connected or is there a problem with the IPad

    Using the Mac with your iPad has nothing to do with the fact that the iPad is running slow. There could be any number of reasons why the iPad is now running slow.
    Have you tried a reset on the iPad?
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • There is problem loading the outline into the memory, error # 1,250,005

    Hello,
    I am getting error message when opening ASO outline on edit mode in EAS 7.1.5 version. EAS server using weblogic and MYSql.
    Error Message:
    There is problem loading the outline into the memory, error # 1,250,005.
    Please let me know if any have experienced same issue or any suggestions.
    Regards,
    DS

    That error is documented as:
    ##1250005 Error [%s] Creating Environment For Outline Paging File: %s
    It sounds like it may be an issue with your temp directories (disk space?) as I believe it is going to copy the outline to a temp directory locally before opening it. That is where I would start looking..
    Tim Tow
    Applied OLAP, Inc

Maybe you are looking for

  • When in Bridge, my image processor won't work anymore

    When I am in Bridge I go to Tools>Photoshop>Image Processor and the dialog box doesn't come up anymore. It does nothing. I use Creative Cloud and all plugins are updated. Help!

  • Photoshop CS4, do you talk to any actual photographers?

    Every time I use the new Photoshop CS4 which is part of my CS4 design standard I get so annoyed with you lot at Adobe. What have you done, I don't think you actually take any advice from real photographers who are using your product every day. Sure y

  • Syndication event for new MDM PI Adapter in MDM 7.1

    Hi, We have setup the new MDM PI Adapter for MDM 7.1 and have created interface in PI using this new MDM PI adapter. All neccesary steps as mentioned in the installation guides are done. Also all necessary remote systems/ports/syndication maps are cr

  • IWeb 3.0.2

    I am trying to upload a change in my site to .mac and it says there is no internet connection. Very strange as can download mails, view pages etc. etc. etc. What can I be doing wrong?

  • After 10.5.2 install stuck at the login screen.  Help please!

    Hi all, After installing 10.5.2 my computer rebooted to the login screen, but no matter what account I select (I have 3) it goes to a blue screen for a few seconds and then right back to the login screen. I've tried booting in safe mode and also rese