Validating a date Please help

I have a string
String a = "29/02/2001";
This is not a valid date. Is there any way to validte this kind of strings.
and if I give a string like
String a="20/02/2001";
this shoud be validated as a valid date
Thanks

thanks that really worked, but one more problem
Can i turn around the string like from 20-3-2001 to
2001-3-20
public DateValidation(String testStr)
     boolean error = false;
     DateFormat formatter = new SimpleDateFormat( "dd-MM-yyyy" );
     formatter.setLenient(false);
     Date date = null;
     if (testStr.length() != 0)
          try
               date = formatter.parse(testStr);
               SimpleDateFormat formatter1= new SimpleDateFormat ("yyyy/mm/dd");
               formatter1.setLenient(false);
               datestring=formatter1.format(date);
          catch (ParseException ex)
               System.out.println("Error parsing date");
public String getDateString()
     return this.datestring;
this is the way i tried out
but when I gave
java DateValidation 30-09-2001
2001/00/30
this is what i got
java DateValidation 3-02-2001
2001/00/03
i keep getting zeros at the month position
Can you help
Thanks

Similar Messages

  • My ipod touch is in DFU mode 5g I need help, do not want to lose my data, please help in Spanish

    I need help, do not want to lose my data, PLEASE HELP IN SPANISH

    Una vez que el dispositivo está pidiendo ser restaurado con iTunes ... ya es demasiado tarde para salvar nada ... y usted debe continuar con la recuperación de ...
    Vea aquí> http://support.apple.com/kb/HT1808
    Es posible que tenga que probar más de una vez ... Asegúrese de seguir todos los pasos ...
    Tómese su tiempo ... Preste especial atención a los pasos 3 y 4.
    Para minimizar la pérdida ...
    Después de haber recuperado su dispositivo ...
    Re-sincronizar su contenido o restauración de la última copia de seguridad ...
    Restaurar desde copia de seguridad> http://support.apple.com/kb/ht1766
    Once the Device is asking to be Restored with iTunes... it is too late to save anything... and you must continue with the Recovery...
    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    To minimise loss...
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766

  • I was updating software and suddenly my IPHONE  started asking for I tunes on mobile screen ,  how can  i  get by screen back or How i can restore without loosing data , I m more worried about data , Please help in resolutio

    i was updating software and suddenly my IPHONE  started asking for I tunes on mobile screen ,  how can  i  get by screen back or How i can restore without loosing data , I m more worried about data , Please help in resolutio

    What exactly are you seeing on the phone's screen ? If the iTunes icon and cable then the phone is in recovery mode, in which case it's too late to take a new backup or to copy any content off the phone - you will have to connect the phone to your computer's iTunes and reset it back to factory defaults, after which you can restore to the last backup that you took or just resync your content to it

  • I am a macbook pro user form last 2 yrs, recently i upgraded to Mountain Lion from Snow leopard. Since then  operational  speed is a major concern. Now It has crashed so very badly that I am scared of my data.Please help me.

    I am a macbook pro user form last 2 yrs, recently i upgraded to Mountain Lion from Snow leopard. Since then  operational  speed is a major concern. Now It has crashed so very badly that I am scared of my data.Please help me.

    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Hi as iam changing the ical message allert date to daybefore automatically it is changing to on the date please help me, hi as iam changing the ical message allert date to daybefore automatically it is changing to on the date please help me

    hi,
    As iam changing the ical message allert date to "daybefore" automatically it is changing to "on the date"   
    please help me,

    You could simplify the decode(... into to_char(sysdate + 1,'d')
    select sysdate + level input_date,
           TRIM(TO_CHAR(SYSDATE + level,'DAY')) the_day,
           DECODE(TRIM(TO_CHAR(SYSDATE + level,'DAY')),
                  'SATURDAY',1,
                  'SUNDAY',2,
                  'MONDAY',3,
                  'TUESDAY',4,
                  'WEDNESDAY',5,
                  'THURSDAY',6,
                  'FRIDAY',7
                 ) daynumber,
           to_char(sysdate + level + 1,'d') alternative
      from dual
    INPUT_DATE
    THE_DAY
    DAYNUMBER
    ALTERNATIVE
    10/14/2013
    MONDAY
    3
    3
    10/15/2013
    TUESDAY
    4
    4
    10/16/2013
    WEDNESDAY
    5
    5
    10/17/2013
    THURSDAY
    6
    6
    10/18/2013
    FRIDAY
    7
    7
    10/19/2013
    SATURDAY
    1
    1
    10/20/2013
    SUNDAY
    2
    2
    10/21/2013
    MONDAY
    3
    3
    10/22/2013
    TUESDAY
    4
    4
    10/23/2013
    WEDNESDAY
    5
    5
    10/24/2013
    THURSDAY
    6
    6
    10/25/2013
    FRIDAY
    7
    7
    10/26/2013
    SATURDAY
    1
    1
    10/27/2013
    SUNDAY
    2
    2
    10/28/2013
    MONDAY
    3
    3
    Regards
    Etbin

  • I have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working except cellular data or 3g data, please help me

    i have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working calling & messaging except cellular data or 3g data, please help me

    Everything you need to know about the solution is written into the question you posed. Get a proper SIM.

  • Not able to convert string attribute to number and date please help me out

    not able to convert string attribute to number and date attribute. While using string to date conversion it shows result as failure.As I am reading from a text file. please help me out

    Hi,
    You need to provide an example value that's failing and the date formats in the reference data you're using. It's more than likely you don't have the correct format in your ref data.
    regards,
    Nick

  • Iphone 5 will not connect to home wifi or Bluetooth after iOS 7.1.1 update! Using unnecessary data please help!

    My iphone 5 will not connect to my home wifi or Bluetooth after I completed the iOS 7.1.1 update. Before the update I was able to connect to my home network with no issues. Now it rarely finds my home network (unless I'm right in front of the router and even still the signal is weak) and when it does find my home wifi network it frequently disconnects from it. I followed previous suggestions to turn off router or forget network settings and re-establish them but it continues to happen.
    This also happening with my Bluetooth connection. My iphone 5 would automatically connect to my home phone Bluetooth prior to the iOS 7.1.1 update. But now my device no longer connects, which means my home phone no longer rings when my cell phone is ringing.
    I probably would be less worries if I did not have to monitor my data usage with Verizon. However, I do have a limited amount of data to use and I recently reached the max and had to pay extra money due to my wifi being unable to connect. Can anyone please help me with fixing this?

    If you have Applecare take it back to the shop and demand a replacement.  If not you're stuffed.  It's a bug that they've put in the software to get you to buy another iphone.  You can maybe warm it up with an hairdryer near the speaker and then turn it off and put it in the freezer for 10 mins then retstart it and wi-fi is there.  It could also be a problem with the chip, if you do the freezer thing it comes back.
    Apple knows its a problem as there are millions of people out there that it is happening to, in my opinion get shut and get a Samsung!!!!    That's what i've done and love my new Samsung S3 Mini miles better than the iphone!!!!
    Go on youtube atnd look how many millions of people this has happened to.
    Someone needs to put this in the media so they will actually do something the robbing bleeders!!!!!
    Also whatever you put on these discussions will get it wiped if Apple don't like what you put!!!!

  • Can't update/install itunes- 'not a valid win32 application' PLEASE HELP

    Hi Guys,
    I'm having some serious problems with installing iTunes on my laptop. I have searched and searched the internet and can not find any solution to my problem. I am receiving the error "itunes is not a valid win32 application' after the program finishes downloading. Sometimes however it will just stop in the middle of the download. I use a SONY VAIO VGN-NW25GF which was only purchased last year. It uses windows 7. I had trouble downloading itunes to begin with though eventually it worked, however since the new 10.1 update has been available ive been attempting to update it almost every time i use itunes. Each and every time it fails and i've had enough as i need to update my iphone software. I’ve since uninstalled both itunes and quicktime hoping it will reinstall properly. But nothing, the same problem is occurring and now i have no itunes program!
    I've tried all the solutions online about deleting browing history/temp folder and any itunessetup.exe/quicktimesetup.exe files and nothing works. I've also tried downloading using a different browser and still nothing. I’ve done a virus scan, disk cleanup and disk defragment and NOTHIGN is working. I'm starting to get quite frustrated as i need this program for my iphone. Any help would be greatly appreciated!! Thanks 

    I have the same problem!!!!PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    -I'm having some serious problems with installing iTunes on my laptop. I have searched and searched the internet and can not find any solution to my problem. I am receiving the error "itunes is not a valid win32 application' after the program finishes downloading. Sometimes however it will just stop in the middle of the download. I use a SONY VAIO VGN-NW25GF which was only purchased last year. It uses windows 7. I had trouble downloading itunes to begin with though eventually it worked, however since the new 10.1 update has been available ive been attempting to update it almost every time i use itunes. Each and every time it fails and i've had enough as i need to update my iphone software. I’ve since uninstalled both itunes and quicktime hoping it will reinstall properly. But nothing, the same problem is occurring and now i have no itunes program!
    I've tried all the solutions online about deleting browing history/temp folder and any itunessetup.exe/quicktimesetup.exe files and nothing works. I've also tried downloading using a different browser and still nothing. I’ve done a virus scan, disk cleanup and disk defragment and NOTHIGN is working. I'm starting to get quite frustrated as i need this program for my iphone. Any help would be greatly appreciated!! Thanks 

  • HTML form to unicode data-please help

    I am devloping a hindi(indian) module. Basicaly it is having an input form accepting hindi inputs ,but the accepting jsp page displays input in form ¤?र' and not in unicode.I have made charset as UTF-8 for data entry as well as inserting jsp page.
    I am using system.println as output before inserting.
    insert into product_descriptions values (116,1,'¤?र');
    The backend is oracle DB .
    Please help me
    Prashant

    Hi,
    Based on your description, my understanding is that you want to save the form data to a file location outside of SharePoint.
    As a workaround, you can save the filled data to a text file using C# and save the text file to a shared folder.
    I suggest you do as the followings:                                                                                                              
    1. Create empty text files in a shared folder using C# File Class.
    http://msdn.microsoft.com/en-us/library/vstudio/as2f1fez(v=vs.110).aspx                          
    2. Write the Data in the html form to the text file using C# StreamWriter.
    http://msdn.microsoft.com/en-us/library/6ka1wd3w(v=vs.110).aspx
    http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx
    Best regards,
    Zhengyu Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Iphone 4 - using lots of data - Please Help :)

    Hi,
    Hope somebody can help me! I recently got an iPhone 4, never used an iPhone before.  Its amazing except its going through tons of data!! I live in South Africa at the moment, so theres nothing like unlimited data, so really cant afford to keep having to upload more and more data.
    I have turned the notifications off for all games, facebook, and mail.  Only notifications remaining are WhatsApp.  Please help!!!
    Could it be a certain app??
    Thanks so much!!!!!

    Hi Wendzket,
    This article details how to control your cellular data usage:
    iOS: About cellular data usage
    http://support.apple.com/kb/HT4146
    It sounds like you have already done the first suggestion, which is a great start.  The other suggestions should further fine tune your data usage.
    Cheers!
    - Ari

  • Hello I have updated my phone to ios6 but after that I lost my contacts , photos , videos and many datas please help me

    I have upgraded to ios6 after which I lost my contact numbers please help

    I am furious and super sad. I spent the entire day trying to recover my data after it told me to update my phone. I did update it and I have lost everything. It went into recovery mode and I tried it all. I almost bought the software mentioned above but because I did not get it to work on neither PC and MAC in demo mode, I was certain it would not work in full mode. I am pretty sure Apple corrupted my system while updating it therefore none of these tricks did work for me. I am trully upset, I am on parental leave and I had all my beautiful photos, videos on there are all gone.
    Reading all day on forums, this issue is more than common. It is exceptional that nothing is done on the company side to prevent it.
    Super sad. But there are lots of third party software that have been developed to help this serious issue. Too bad none of them worked for me.
    iphone is the only phone that does not allow anyone to select the photos right from the drive and get them. it has to go through this annoying itunes process to sync (and it has to be the right associated machine, the right itunes, it is super slow, etc.), therefore it is very common for people to loose their data because they just dont have time to go through this long annoying process regularly.

  • Recive deleted pictures with out icloud or any back up from last restore date please help need to find a very important picture

    i have problems with spelling
    There surely has to be a way to recive my pictures from deleted memory on my iphone 4
    i deleted my pictures from this weekend and need to view them but i deleted them with out having icloud or any back up app
    is there ANY one who know's how to get around this there has to be a way like a computer like a restore factor settings that lets you go back to the last time you took a picture
    Please Help Driving me insane

    Richie K wrote:
    im still not conviced i might go to the iphone store tomorrow and see there has to be a way thank you for you help if you come across anything like this please let me know
    Good luck, but they will tell you the same thing that anyone here will tell you.
    Unless the device was backed up (via iTunes or iCloud) after the pictures were taken but prior to deleting them on the device, they are gone.  There is no way to recover them once deleted without a backup.

  • HT201269 i lost my passcode and dont want to lose my data. please help me

    please help to get back my passcode
    my mobile is still activated and getting calls by unfortunately i lost my passcode

    We can't guess your passcode. If you can't remember it, you will have to restore from your last backup.

  • Find my iphone not working on 3gs (with a valid account). Please help?

    Hi All,
    I created a free Mobile Me account with my iPad and enabled 'Find my iPhone' on it. After that, I went to my 3GS and activated 'Find my iPhone' successfully.
    The thing is: nothing works with the 3gs. With the iPad, I can lock it, and send messages to it (I didn't try to erase it, for obvious reasons). I cannot send messages to the 3GS and can't lock it, either.
    Both devices with the latest iOS version (4.2.1).
    I tried erasing all email accounts, and reseting network configuration. Push enabled.
    Please help
    Thanks
    Message was edited by: yogurtu

    There is a loop hole. Just register your account using the same steps on any iphone4 ipad or itouch 4th gen FIRST then u'll be able to use your account on your 3gs that allows it to track your iphone...up to a max of 3 diff devices. google the other forums, this was what i read from them.

Maybe you are looking for

  • UWL - Retrieve Rejection text entered via UserDecisionNote

    Hello SDNers, I am using task TS20000131 for expense report approval process. I have setup UWL configuration for the same and every thing works fine except the Rejection text. In UWL configuration I am using UserDecisionNote and DecisionKey for inclu

  • Generating barcode with reports 10g

    I need to generate a report (developer 10g) with a barcode. I´m following the instructions on a paper but I need to import a Java Class which I can´t find oracle.apps.barcode.util.BarCodeConstants and oracle.apps.barcode.BarCodeMaker. Do I need to do

  • Not saving addresses

    I have the current version of iOS on an iPhone 3G. In Mail when I click on an email address I have the option to create a new contact. I click to create the new contact. I go in my Contacts and the eddress isn't there. Is this is known problem? It se

  • HELP WITH BLACKBERRY APP WORLD

    I have recently upgraded frm the blackberry curve 9300 to the 9320 and I had purchased a theme which is apparently not available for this new device, also can u tell me when more themes will become available for the os7 version as a lot of my old one

  • Problem opening my own file

    I have Adobe CS5, version 7. I have not had any problems creating files. I went to open one of my personal files and it is now telling me that I cannot open it as I need updated plugins.  Why would I need updated plugins if I was the originator of th