How can i get the previous date?

Hi,
I am entering a future date(xx-xx-xxxx) through my application.I need to perform some actions on the previous date of the entered date(xx-xx-xxxx).How can i get that previous date?

Oh dear god.
Parse the date using SimpleDateFormat. You can then use Calendar's setTime to set a Calendar instance to your date, and use add(Calendar.DAY_OF_MONTH, -1) to substract a day. getTime() will then provide a new Date. And yes, look it up in the API docs.

Similar Messages

  • How can i get the meta data from database?

    Hi, all java and db experts,
    I need to write a tool to generate java file which will be used to hold the resultset of a stored procedure of Oracle. Is there any API call or tools to connect to db and then get the meta data of the return cursor instead of reading stored procedure definition on my own?
    Please help, thanks a lot.
    Hanna

    if i execute a Oracle stored procedure, the resultset of a cursor is returned. It's easy to know the meta data at the runtime.
    However, could i get the meta data about the resultset of a cursor before runtime? Such as by connecting to the database and ask it about meta data of a specified stored procedure?
    Is it feasible?
    DatabaseMetaData dbmd = conn.getMetaData();
    ResultSet rs = dbmd.getProcedureColumns("", "%", "SP_NAME", "%");
    while (rs.next()) {
    String colName = rs.getString(4);
    int colType = rs.getInt(5);
    int colDataType = rs.getInt(6);
    int colPrecision = rs.getInt(8);
    int colLen = rs.getInt(9);
    int colScale = rs.getInt(10);
    long defaultValue = rs.getLong(11);
    But what i get is a list of stored procedure parameters. In oracle, cursor is IN OUT parameter . How can i get the meta data about the resultset of cursor?

  • I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date is created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date  created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    The Finder reports File information. The date and time of the photo are in the Photo's Exif metadata. The Finder has no awareness of this. All photos apps on any system do.
    Regards
    TD

  • How can I get the system date in mm/dd/yyyy,

    how can I get the system date in mm/dd/yyyy, i need to compare system date with some other date,continuosly using threads,can U plz help me.
    With Some code
    Thanks In advnace
    Mahiiii

    Hi,
    You can use SimpleDateFormat class under java.text package.
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy h:mm a z", new Locale());
    //formatter.setTimeZone(timezone);
    String dateTime = formatter.format(new Date());

  • How can I get the previous record's field value in a VO

    Hi I would like to know how can I get the previous record's field value in a VO
    For example : I have a VO porequisitionlinesvoimpl, and it contains 5 records (porequisitionlinesvoimpl.getRowCount() = 5). How can I search all records in the VO and get the field (attribute3) for all records?
    Many thanks anyone can help
    Lawrence

    Hi ,
    U can loop through the VO to get the value of attribute3,
    need to extend the controller ,use below code
    OAViewObject vo = (OAViewObject)oawebbean.getApplicationModule (VO1);
    OARow row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator Iter = vo.createRowSetIterator("Iter");
    if (fetchedRowCount > 0)
    Iter .setRangeStart(0);
    Iter .setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    row = (OARow)Iter .getRowAtRangeIndex(i);
    String value = (String)row.getAttribute("Atrribute3");
    Thanks
    Pratap

  • How can i get the previous version of iTunes back

    I have a MacBook with a DVD/CD drive, Mac OS X (10.7.5). I recently updated to iTunes version 12.0.1.26. It seems to be designed for Macs without a DVD/CD drive. How can I get the previous version back? I don't have a back up or use time machine.

    Thanks Chris, there a number of problems I'm experiencing. When I insert a CD, despite the preference being ticked, I nolonger get the box that asks me if I want to import. When I did manage to import I couldn't find where the file had gone. Perhaps what I need is a good user guide for the latest version of iTunes because at this point the impression I have is unless I'm buying from iTunes nothing seems to work as it previously did. It is impossible to add anything to my library.
    I'd be the first to admit I'm no computer nerd and all the information I've found so far to try and sort out my difficulties don't seem to work. Can someone please tell me where can I get a good user guide for iTune 12.0.1.26 because I find it far from intuitive? At least then I have a chance of working out if it's me or the machine.
    Many thanks in anticipation.

  • I made iOS7 update, a big mistake , such a ****, how can I get the previous version ?

      I made iOS7 update, a big mistake , such a ****, how can I get the previous version ?

    Sorry, but you cannot downgrade the iOS now.

  • HT1692 how can i get the previous contact details in iphone

    how can i get the previous contact details in iphone

    You don't want to maintain a reference to the last selected node, but to the last selected path. Nodes within a tree are addressed using a TreePath, with contains references to each node from the root, down to a specific node. Look at the JavaDocs of javax.swing.tree.TreePath for more info.
    Also, JTree has getter/setter methods for the selectionPath.

  • Hi, can you help?  My emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    Hi, The emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    That's very scary. They might do it, but I personally have never had Apple contact me re id's except on their site when signing in. I suggest you DO NOT respond until you have a phone conversation with Apple security. They can verify if they sent you the e-mail and why.
    While it's very possible it's true,again, I suggest you not respond until you speak to someone at Apple. I've often read here that when people sign in they are not allowed to because "someone else has used the id" type of statement.
    Also, you should be able to go to the app store and see what apps you have downloaded.
    Though it could have been a free app, have you checked to see if any were bought with your id account?
    I've gotten these types of e-mails from places like USPS and FedEx which look amazingly authentic and were from their website. I also received an odd e-mail from my cousin in Ireland last year that clearly was not from him. It was also sent to others in his family in Ireland. I e-mailed him that I only opened it because it had a .ie, but suggested he change... Days later I received mail from 'him' - same name, but at yahoo.com. 
    Again, I would call Apple. You can also report it at [email protected], but I would not settle for that given your situation. If nothing else, call Apple sales (sales depts. anywhere answer fast) and ask them to transfer you to security. Apple will not want anybody accessing their name, and while it's unlikely, it's not impossible that it is someone phishing.
    Hope this helps and can you let the support community know your results by posting on this thread when you're done? Thank you.
    Hope this helps.

  • Please help.........how can i get the last date of the month?????

    Hello....
    I want to get the last date of the month.
    For example, the last date of Jan is 31.
    How can I get the last date of the particular month and year ????
    Thanks for help.
    Gloria

    Hi Gloria
    1. How can I compare the date???date1.compareTo(date2)
    where date1 and date2 is a java.util.Date Object
    will return 0 if it is the same date
    or
    date1.after(date2)
    where date1 and date2 is a java.util.Date Object
    will return true if date1 is after date2
    (the same for date1.before)
    2. How can I change the date format into yyyymmdd format???? I just want the year, month and date.try the java.text.SimpleDateFormat Object
    new SimpleDateFormat("yyyymmdd").format(yourdate)
    Hope this help.
    Please also have a look at a calendar I wrote, (maybe it help)
    demo & source :
    http://www.geocities.com/globe_software/java/components/
    globe_sa

  • TS4009 How can I get the previously version of my contacts in iCloud storage

    I have some problems after installing the new iOS6. How can I get the previously version of my contacts in iCloud storage (not the last one)?

    If you have noe backup - you cannot

  • How can I get the image data from Clipboard with LV

    Anybody knows How can get the image data after pressd "print screen button" with LV?
    I want to program a software which can save a image as a bmp or jpeg etc, and the image data is from pressed print screen button. 
    How to get it out from clipboard. I am trapping about. thanks in advance.
    Try to make everything Automatic

    You can have a look at Rolf Kalbermatter's post here (give him stars) or, if you're using scripting, you can use the Application class Get Clipboard Image method.
    Try to take over the world!

  • How can I get the start date and end date of a certain week?

    Hello, in my java code, I can get the week ID , using
    org.joda.time.base.AbstractDateTime.getWeekOfWeekyear() , for example, this week is the 16th week of this year. And I want to get the start date(date of Monday) and end date(date of Sunday) of the week. Is there any method can supply such date value??thanks

    1 public Date getCurrentMonday(){
    2 Date monday = null;
    3 Calendar rightNow = Calendar.getInstance();
    4 int day = rightNow.get(Calendar.DAY_OF_WEEK);
    5 int distance = 0;
    6
    7
    8 if (day == Calendar.MONDAY)
    9 monday = rightNow.getTime();
    10 else
    11 {
    12 distance = day - Calendar.MONDAY;
    13 if (distance == -1)
    14 distance = 6;
    15
    16 monday = (Date) (rightNow.getTime());
    17 monday.setTime(monday.getTime() - 1000 *60 *60 *24 *(distance));
    18 }
    19 return monday;
    20 }

  • How can I get the previous clicked node in a Tree?

    I have a JTree. If a node is selected, before the user select another, I need to make a question if he have sure about the new selection.
    If the user answers not, I need to select the previous node.
    I have in my class a variable, type of DefaultMutableTreeNode, that makes reference to the last node selected.
    How can I turn this node selected again, if the user select "No"?
    Thanks for any help.
    Renato de Melo

    You don't want to maintain a reference to the last selected node, but to the last selected path. Nodes within a tree are addressed using a TreePath, with contains references to each node from the root, down to a specific node. Look at the JavaDocs of javax.swing.tree.TreePath for more info.
    Also, JTree has getter/setter methods for the selectionPath.

  • How can i get the recurring date

    Is there any API can provide the recurring date i selected?
    I know token "ItemGetDate" can provide me an appointment 's assign, create, begin, DueDate, end date, otherwise the DataType Duration(0) i always failed to get anything.

    Hi,
    Depending on the cycle type will dictate the next invoice date. 
    So if you had a monthly recurring order starting today on July 27, 2012 the next upcoming date will a month from the date.  However the invoice will send 14 days prior to the upcoming date. 
    For more details please view the article below on how this works exactly.
    http://kb.worldsecuresystems.com/239/bc_2391.html#main_How_the_invoicing_works
    Kind regards,
    -Sidney

Maybe you are looking for

  • How do i share media (music and videos) between all of my devices?

    i currently have (and attempt to use as much as possible) the following devices:  macbook pro 15", ipad 4, iphone 6 plus 64 GB, and appletv 2. i would love it if these devices would talk to each other correctly.  first came the macbook, and i took an

  • When I open firefox the toolbar is greyed out and there is no address or bookmarks available

    When i open firefox there is no address and no bookmarks saved. The toolbar buttons are also greyed out. I have not updated anything and have disabled plug ins and add ons but no change. Have read similar posts but cannot understand the suggestions a

  • Zen Micro with Windows 2000 Not Recogni

    Help!! My computer operating Windows 2000 no longer recognizes my Zen Micro. It used to but no longer. I have searched through all the help loading everything under the sun with no success. My Micro is operating with Version ..0 that I understand sho

  • Dhcp fallback

    hey, i'd like eth0 to try dhcp, and if it doesn't receive an answer within 10s or so, fall back to an address i specify! how do i do this? (i'd like to specify something like eth0="dhcp eth0 192.168...." in rc.conf) thanks

  • How to type chinese character in Oracle Report builder 6i?

    Hi, Does anyone know how to include the chinese character in the rdf file under Oracle Report Builder 6i?