Validate the Date Time

Does any java library class support to validate the date of the user input?

Error index is concerned with the pattern not with the value.
SimpleDateFormat test = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition p = new ParsePosition(0);
p.setErrorIndex(-1);
Date d=test.parse("2002-1130",p);  //does not match the pattern
System.out.println(p.getErrorIndex()); // index other than -1 expected
p.setErrorIndex(-1);  //  initialize
d=test.parse("2002-11-31",p);// match the pattern but value invalid
System.out.println(p.getErrorIndex()); //-1 expected

Similar Messages

  • How to validate the dates in the table control ?

    How to validate the dates in the table control ?
    Can I write like this ?
    LOOP AT it_tab .
    CHAIN.
    FIELD : it_tab-strtdat,it_tab-enddat.
    module date_validation.
    ENDCHAIN.
    ENDLOOP.
    Module Date_validation.
    ranges : vdat type sy-datum.
    vdat-sign = 'I'.
    VDAT-LOW = it_tab-STRTDAT.
    VDAT-HIGH = it_tab-ENDDAT.
    VDAT-OPTION = 'BT'.
    APPEND VDAT.
    WHAT CODE I have to write here to validate ?
    and If I write like this How can we know which is the current row being add ?
    It loops total internal table ..?
    Bye,
    Muttu.

    Hi,
    I think there is no need to put chain endchain.
    To do validation you have to write module in PAI which does required validations.
    Thanks
    DARSHAN PATEL

  • How do I to get the date/time stamp back on my texts in ioS7?

    I've looked and looked to find an option and I can't seem to locate one.  Does anyone know how to put the date/time stamp back...?  It does appear in, but not consistently.

    Swipe right to left and they will appear as you need them.

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • How can I get the Date & Time to appear on my final project in iMovie11?

    I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear.  How can I get the Date  & Time data to appear on the final product?

    There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.

  • Why can't I sync my facebook invitations to my iCal?  My Mac Mail won't detect the date/time on the email anymore.

    I have been trying to sync my facebook invitations to my iCal and no longer able to do this through my Mac Mail.  When I would receive a facebook invitaiton through my comcast email, I used to be able to hover my mouse over the date/time of the invitation and then I could easily "Add to iCal" or "See Date in iCal", but am no longer able to do so.  I can still add other invitations, just not the facebook invitations.  Any ideas?

    You can get your photos off your phone.  If they are all in Camera Roll just import them to your new computer (http://support.apple.com/kb/HT4083).  If some of them were synced to your iphone from your computer (i.e., in photo library) just use an app like PhotoSync and send them to your new computer wirelessly.  For that matter, you can sync your phone with your new computer without losing your data and settings if you carefully follow this guide: https://discussions.apple.com/docs/DOC-3141.  Your only issue will be non-purchased music on your phone which is not in your new iTunes library, which will require 3rd party software such as Touch Copy to transfer from your phone to iTunes (or you will have to rip you CDs again to import them).

  • After Add Instance occurs the date/time field data is removed.

    I have multiple dropdown options that adds or deletes a row from a table.  Trouble is after I have placed a date or time in fields elsewhere on the form, that data is deleted after I make a selection on the dropdown.  The dropdown has the options of In, Out, N/A, or N/O and when Out is selected the AddInstance is invoked adding a row to the table and when any of the others are selected the RemoveInstance removes the row.  This part works fine but the values in the date and time fields are removed as a result of the selection.  I have multiple dropdowns, and the code below will keep my data in the fields on the first selection but on subsequent selections the data for the data/time fileds are removed.  Any recommendataions on what is going on and how I can stop this?
    My codes appear below.
      if (this.rawValue == 1)  // If the value selected is "Out" of compliance then ...
         School.ItemListPage.ObsRec._Rows.insertInstance(0);  // Add an item to the table
         xfa.form.recalculate(false);
      else  // If the value selected is "In", "N/A", or "N/O" then ...
         School.ItemListPage.ObsRec._Rows.removeInstance(0);  // Remove this item from the table
      endif

    Hi,
    TRUNC( ) Function retrieves date part of DATE (date and time) datatype.
    Regards,
    Sailaja

  • How to change the date/time

    Now I chang the CMLocal date/time group and apply it to Device pool for phone, but I find the date/time displayed on phone is wrong ?why?

    I have the same problem with CCM 4.1(3)SR3 and Cisco IP Phone 7970.
    Can you help me please?

  • How to display the Date Time using the System Time zone

    Friends,
    Can anyone help me with below scenario..
    I have to display Date Time on a jsff page, This value associated to one of Transient View object populated from the database.. Is there any way I can handle on the screen to display the same date /time bassed on the system time zone ?
    I know one way how we can handle it.. while populating to View object we can set the time based on the system time zone.. but it would be easy and simple if there is any approach I can use on UI layer itself..
    thanks

    I don't understand why this display doesn't pay attention to the date/time format settings that are set in the language and text prefs.
    Those settings are used for date OR time, and provide for different displays depending on the space available. The menu bar does not have a fixed space available, and wants both date and time.
    In Leopard, it used the medium time format. To get the date and time, you could modify that format to include the date, but that could cause problems with software that happened to use the medium time format and expectede just the time. Also, you might want to change the medium time format without changing the menu bar display. For these reasons, Snow Leopard's menu bar clock uses its own formatting for data and time display.

  • How to validate the date in my class

    Hi
    In my project with jsp and struts I need to validate the date field.
    So in the action class I want to validate the date that is the date is in dd/mm/year format?
    can anybody please give some idea to do this?
    Thank you so much.

    Here is a method that validates day/month/year using the Calendar class.
         public boolean validateDate(int day, int month, int year) {
              try {
                   Calendar cal = Calendar.getInstance();
                   cal.clear();
                   cal.setLenient(false);
                   cal.set(year, month-1, day);
                   // need to call getTime() to make the calendar compute/validate the date
                   cal.getTime();
                   return true;
              catch (IllegalArgumentException e) {               
                   return false;
         }

  • How do I change the date/time of a dll created in LabVIEW without killing it

    I use the LabVIEW (6.0.2 of course) Application builder to create a dll, and I cannot enter creation information, nor can I modify the date time property, which labVIEW does not properly set. I have tried to modify this information in Visual C++, but that destroys the dll because it wasn't compiled in VC++, and therefore isn't compatible.
    If anyone knows how to correctly modify the date/time (and the checksum) without destroying the dll, I would be gratefull to know.
    Thank you

    Dear Sir,
    I was browsing through MSDN in trying to find the info you are looking for and I step into this next file:
    "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format"
    Which you can locate in the msdn.microsoft.com page by going to the search box and typing that title. The first result is that document. Also you may want to check the "imagehlp" file of the msdn library. This documents provides information on the DLL standard and functions.
    Good luck!...
    Nestor Sanchez
    Applications Engineer
    National Instruments
    Nestor
    National Instruments

  • How do you remove the date/time stamp from a photo before printing?

    I have one group of photos in an event that have the date and time stamp on them.  I don't know how to remove the date/time stamp before printing. 

    If you have your camera set to imprint the date/time on the photo you can not "remove it - it is a part of the photo - depending on the surounding photo you might be able to retouch it out
    LN

  • Adding the date/time stamp to videos already created

    We have someone using Elemets 8
    They need to add in the date/time stamp to video's that are already created.
    The camcorder we have does record this information but doesn't allow that information to be put onto the screen its a Canon HD HF200
    We were told by Adobe support we can do this but they wanted $39 plus $39 an hour.
    Anyone out there able to tell me how we can get this done for free?

      Try the Premier Elements forum for video questions. You will get better advice over there. Good luck.
    http://forums.adobe.com/community/premiere_elements

  • I just did something on my mac and now the date, time and battery percentage are in arabic and it says lebanon (arabic) in the language and text preference, how can i change it back to english? ps: i'm hopeless.

    i just did something on my mac and now the date, time and battery percentage are in arabic and it says lebanon (arabic) in the language and text preference, how can i change it back to english?
    ps: i'm hopeless.

    So what you want is for it to say Lebanon (English)?  If so, see if this helps:
    http://m10lmac.blogspot.com/2012/05/fixing-custom-english-region-settings.html

Maybe you are looking for

  • Video Doesn't display ?

    Hi. I create a simple page & put an apDiv box on the page. I then put a small swf file in it. Everything looks good & I even test it out in "Preview in Expolorer & Firefox". Video plays great. Only thing is when I go to the live URL nothing apears...

  • Acrobat 6.0 Plugin issue

    Have acrobat on  Vista ultimate machine.  The 6.0.6 update is installed.  Navigated to a site for a PDF download.  The message panel "Acrobat plugin"  cannot find acrobat is encountered.  Have performed detect and repair with no findings.  Windows ev

  • Idocs neding in 64 status and not processed further

    Hi We have inbound idocs of FIDCC2 message type, which are set to be triggered immediately. However we have noticed that sometimes (not always) these idocs are in 64 status and are not processed further. We have to manually reprocess them. What could

  • Events in classical report

    Hi Gurus, Please provide me the correct sequence of all possible events in a classical report. Thanks, Binay

  • Lightroom mobile closes immediately after starting

    Hi when I launch adobe lightroom mobile 1.10 on my ipad retina latest iOS updates it closes immediately without any messages. This has started happening after adding photos from the camera roll. There was not enough space so I deleted some of the pho