How to add get Day value in a Date object?

Hi,
I am writing a sql statement that has two date values. One I am getting it from the database. The format in the database is MM/DD/YYYY. My first question is how do I convert the format into the java date format, YYYY-MM-DD. The second question is I need to find out what the day is and add 1 to it. How do I get Day value in a Date object?
Thanks.

Look at "SimpleDateFormat" and "parse" in the archives.

Similar Messages

  • How to Add 15 Days to the current Date in eCATT

    Hello eCATT Guru's,
    How to add 15 days to the current date in eCATT.
    I have changed the Date format to mm/dd/yyyy.
    now i want to add 15 days to the sy-datum.
    How to do that.do any one know?
    Thanks in Advance,
    Raj

    Check out this link -
    http://help.sap.com/saphelp_46c/helpdata/en/d7/e21a50408e11d1896b0000e8322d00/frameset.htm
    It gives details about DATE variables in CATT. Hope this will help you out.
    ashish
    Reward points if you find this helpful.
    Message was edited by: Ashish Gundawar

  • How we add Grace days to net due date

    Hi,
    How we add grace days (eg one week) to net due date? This is only for particular customers.
    Regards,
    Shaik

    Hi Azeen
    Try this way. I assume that you want to know how much is due from customers as on a particular future date, that should come between today and that date. For preparing the liquidity forecast for the month, I use the following method for estimating the recoveries from the Customers and payments to Vendors and it works quite well for me.
    Let's say for Customers you want to forecast the collections that would come in the month of Jan from today until 31 Jan'09. Use the FBL5N Report, using the 'Open Item Key Date' as a future date, in our example - 31 Jan'09. Change the layout of the report by including the feilds 'Net Due Date' and 'Arrears after Net Due Date'. Sort the report on the Document Date, this being the baseline date. Now in the 'Arrears after Net Due Date' you will find the overdue days, which would be equal to the difference between the Date of the Report (31 Jan'09) and the Net Due Date of the Open Item. Thereafter, use the filter for 'Arrears after net due date' and click on the icon for 'multiple values'. Exclude the range of days, by assigning the lower and the upper limits. Lower Limit will be in minus, for those invoices that would still not be due upto 31 Jan'09 and the upper limit will be 7, since you would be granting a grace period of one week and consider all those invoices as not due upto 31 Jan. Once the filter is set, the report will exclude the open items as per the filter and provide you with a fairly accurate estimate of collections for the period/month.
    Let me know if it works for you.
    Regards

  • How to display only Day value instead of DATE in Bex Report

    Hi Experts,
    We have a Month to date Report, in this report we need to display only day value instead of DATE value,
    Like
    if Date is 14.05.2010 we need to show only  14
    Regards,
    Chandra

    Hi ,
    Thanks for Quick Response
    we does have the option to create the char(calday or ...) value variable replacement with char (calday or ...) info object, we can  replace with Report r variable value only not with info object.
    i hope we can replace the with info object only with formula variable with replacement.
    My BEx Report is Designed like
    Columns
    0Calday
    Rows
    Plant
    Keyfigures
    Actual
    Plan
    Report output Looks like month to date
    0CALDAY            01.06.2010   02.06.2010  03.06.2010
    P1  ACTUAL            10                     8                    4
    P1  PLAN                 15                     6                    2
    P2  ACTUAL              5                   10                     7
    P2  PLAN                  4                      8                    3
    Report should be
    0CALDAY            1    2     3
    P1  ACTUAL      10     8      4
    P1  PLAN           15     6     2
    P2  ACTUAL        5    10    7
    P2  PLAN            4      8     3
    please let me know how can i achive this
    Regards
    Chandra

  • How to add 15 days to the current date

    Hi everyone,
    I have the following doubt.
    I stored the current system date in to a variable.Now I want to store the date which is 15 days after the current date in to a new variable.
    ie current date:1-aug-09
    later date:1-aug-09 + 15 days ie 16-aug-09.
    Plz help me in solving this problem.
    Thanks & Regards,
    srinivas

    jaligamasrinivas wrote:
    I used String variable to store the current Date.
    Now in new string variable i want to store the date after 15 days from current dateSee reply #2. String is not the right type, to be doing date arithmetic, just like it wouldn't be the right type to do numeric arithmetic. You wouldn't store integer values as strings and ask how to add them up, would you?

  • How do I get the value of a field object programatically after loading a report

    I'm using CR 11.5 and VS2005 in a console application, there is no GUI. I have a report with a page header that has 3 field objects. These field objects, their values change for every record and I want to be able to capture the value of these field objects in code for further processing outside of CR. Is this possible?
    Thanks in advance!
    I should explain a little more, the information I'm trying to obtain is in the Page Header section of the main report. There are subreports. Basically what I'm trying to put together is a list of how many pages are part of each record, the number of pages fluctuates per records so I need to be able to cycle through. Any other suggestions?

    When accessing the fields on the report through the SDK you will only get what database field they are using for data.  The internal data collection that is used by the report can be gathered using the rowsetcontroller from the ReportClientDocument.

  • How to add some days to the current system date

    can anyone help how to add some days to the current date i.e if today is 3-12-2007 and if v add 15 more days then the output should be 18-12-2007

    RajeshChandan wrote:
    First of all thanks a lot ,and coming to the question i dont mean to change the sysdate instead i want to write a prg. where after entering the current date it should effect with the no.of days that i have given but not the system date .if u can answer please reply for thisAh, I see. In that case, you can use an instance of GregorianCalendar and use it's add(...) method to add days, months, years etc. to it.
    http://java.sun.com/javase/6/docs/api/java/util/GregorianCalendar.html
    Good luck.

  • XSLT Mapping: how to add one day to TimeStamp

    Hello Experts,
    My requirement is to add one day to current timestamp. Used $TimeSent to get the currenttimestamp. In Expired field, the need to add one day
    say Created= 2011-03-30T20:29:13Z
           Expired = 2011-03-31T20:29:13Z
         <xsl:param name="TimeSent"/>
         <created><xsl:value-of select="$TimeSent"/></created>
         <expired>2011-03-31T20:29:13Z</expired>
    How to add one day to the current timestamp. I am new to XSLT mapping and need some help with the code.
    Thanks
    Shikha Jain
    Edited by: Jain Shikha on Mar 30, 2011 8:34 PM
    Edited by: Jain Shikha on Mar 30, 2011 8:36 PM

    Hello All,
    Thanks for your reply. i tried the function and the code is working when i am testing in stylus studio. But the same code gives error when i  tested the xslt mapping in PI (Error: TransformerConfigurationException triggered while loading XSLT mapping).
    $TimeSent function is working when code is tested in PI , but it doesnot give value in stylus studio. Also Current-dateTime() function is doesnot give value in PI but works in stylus studio. Is there any difference in the functions used in stylus studio and XSLT mapping in PI?
    Also if i remove the code used for function(to add one day to timestamp), and use constant value(2011-04-02T23:24:56.763Z)the code is working fine in PI. Please help me to find out where the code is going wrong when tested in PI.
    Below is the XSLT code i am using
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ds="http://xsltsl.org/date-time" xmlns:functx="http://www.functx.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xsl:function name="functx:next-day" as="xs:date?">
          <xsl:param name="TimeSent" as="xs:anyAtomicType?"/>
          <xsl:sequence select="xs:date(current-date()) + xs:dayTimeDuration(&apos;P1D&apos;) "/>
       </xsl:function> 
    <xsl:template match="/">
          <xsl:param name="TimeSent"/>
          <soapenv:Envelope xmlns:olsa="http://www.skillsoft.com/services/olsa_v1_0/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
             <soapenv:Header>
                <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                   <wsu:Timestamp wsu:Id="Timestamp-191900" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>
                         <xsl:value-of select="$TimeSent"/>
               </wsu:Created>
    <wsu:Expires>
         <xsl:value-of select="concat(substring(functx:next-day($TimeSent) ,1,10) ,&apos;T&apos;, current-time())"/>                  </wsu:Expires>
                   </wsu:Timestamp>
                   <wsse:UsernameToken wsu:Id="UsernameToken-19030197" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                      <wsse:Username>ABC</wsse:Username>
                      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">XYZ</wsse:Password>
                      <wsse:Nonce>erDTBNoUWv7GdHDaErrLwA==</wsse:Nonce>
                      <wsu:Created>2011-02-15T23:24:56.763Z</wsu:Created>
                   </wsse:UsernameToken>
                </wsse:Security>
             </soapenv:Header>
             <soapenv:Body>
                <olsa:GetMultiActionSignOnUrlRequest>
                   <olsa:customerId>ABC</olsa:customerId>
                   <olsa:userName>XYZ</olsa:userName>
                   <olsa:actionType>launch</olsa:actionType>
                   <olsa:assetId>222499_eng</olsa:assetId>
                   <olsa:groupCode>testgrp</olsa:groupCode>
                </olsa:GetMultiActionSignOnUrlRequest>
             </soapenv:Body>
          </soapenv:Envelope>
       </xsl:template>
    </xsl:stylesheet>
    Thanks
    Shikha Jain
    Edited by: Jain Shikha on Apr 2, 2011 9:51 PM

  • How To Add Number Days in jsp

    Hi,
    I want to add number of days in a date string using jsp.
    <%--
        Document   : try5
        Created on : May 20, 2008, 6:00:20 PM
        Author     : thamaraiselvan
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <%
            String datetxt="2008-05-20";
            %>
        </body>
    </html>How to add 30,90,180,365 days in that String datetxt value.
    Thanks Alot....

    Hi,
    How to format a string value into a Date.
    I typed the following code .but its gives a exception.
    <%--
        Document   : try5
        Created on : May 20, 2008, 6:00:20 PM
        Author     : thamaraiselvan
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,java.util.Date,java.util.Calendar,java.text.SimpleDateFormat" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>JSP Page</title>
        </head>
        <body>
            <%
            try
            String datetxt="2008-05-20";
            int e=30;
           // calendar.set(Calendar.DAY,calendar.get(Calendar.DAY)+30);
           // Calendar cal = Calendar.getInstance();
            //Date today = cal.getTime();
            SimpleDateFormat fmt =new SimpleDateFormat("yyyy-MM-dd");
            String thamu = fmt.format(datetxt);
            out.println(thamu);
            catch(Exception e)
                out.println(e);
            %>
        </body>
    </html>Exception Like This :
    java.lang.IllegalArgumentException: Cannot format given Object as a Date .
    After Formatting to date i want to add 180 days from '2008-05-20' .
    Please Help me...
    Thanks Alot....

  • Please, How do i get the values from a h:selectManyCheckbox ?

    How do i get the values (selected or not) of a <h:selectManyCheckbox> tag and show them .For instance
    i have the folowing options :
    <h:selectManyCheckbox
                           id="cartas"
                       layout="pageDirection"
                        value="#{store.cartas}">
          <f:selectItems
                        value="#{cartas}"/>
        </h:selectManyCheckbox>
        <h:message styleClass="validationMessage" for="newsletters"/>with my faces-config.xml:
    <managed-bean>
        <description></description>
        <managed-bean-name>cartas</managed-bean-name>
        <managed-bean-class>java.util.ArrayList</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
        <list-entries>
          <value-class>javax.faces.model.SelectItem</value-class>
          <value>#{cartas0}</value>
          <value>#{cartas1}</value>
          <value>#{cartas2}</value>
          <value>#{cartas3}</value>
        </list-entries>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas0</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Semanal</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>200</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas1</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>As bruxas</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>201</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas2</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Exercise</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>202</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas3</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Gusman Park</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>203</value>
        </managed-property>
      </managed-bean>Thanks for the atention!! All the best!!

    Hi,
    In your backing bean you will need to add a new variable to bind your control to, I think this variable needs to be of teh "HtmlSelectManyCheckbox" type. The on your jsp page you can add binding="#{myBean.myVariable}".
    When you want to get the values of the selectMany in your backing bean, you can call the getSelectedValues() function on your HtmlSelectManyCheckbox variable.
    in backing bean:
    private HtmlSelectManyCheckbox hsmc;
    public HtmlSelectManyCheckbox getHsmc(){
        return hsmc;
    public void setHsmc(HtmlSelectManyCheckbox hsmc){
        this.hsmc = hsmc;
    public void someFunction(){
       Object[] obs = hsmc.getSelectedValues();
    }On jsp page:
    <h:selectManyCheckbox
                           id="cartas"
                       layout="pageDirection"
                        value="#{store.cartas}"
                         binding="#(myBean.hsmc}">
          <f:selectItems
                        value="#{cartas}"/>
        </h:selectManyCheckbox>

  • How can I get the value of "Warehose" column in a form

    How can I get the value of "Warehouse" column in the form below (I mean what table that contain this value):
    Production Supervisor >> Batches >> (Button) Material Details >> (Button) Line Allocations
    Well, for more clearly! My problem is I must have the Unit Cost of Items, so I've got it in the cm_cmpt_dtl (table), but if I want to, I must create a relation that require 2 filed, they're Item_ID and Whse_Code.
    There's no problem with Item_ID, but Whse_Code seem to be the Mission Impossible (hix, I hate that film!!!!)
    I wonder if It was right to post this topic here. But anyway I just post my question here, hope I could get some help.

    wow, many, many, many.... and many thanks!
    Just add a tiny modify to check out the Batch_type
    doc_id = (select batch_id from gme_batch_header where batch_no='&batch_number' and batch_type = 0)
    Because the batch_no can be duplicated as we also create Batch and Filrm Planned Order.
    Many thanks for your support!
    P/S: Sorry for my terrible English :P

  • How to add a default value in a site column for every item in a document library

    HI
    i created a content type with some site columns ,
    and included in a Document library.
    Process ( content type)
    -ProcessNo
    -ProcessName
    after that i uploaded 100 Documents but not  added value in a site column process name.
    now  how i add a default value in a site column for every document in a document library 
    adil

    HI
    i get below error when i change the script 
    PS C:\scripts> C:\Scripts\updatedefaultvalue.ps1
    Cannot index into a null array.
    At C:\Scripts\updatedefaultvalue.ps1:8 char:7
    + IF($i[ <<<< "Title"] -eq $null)
        + CategoryInfo          : InvalidOperation: (Title:String) [], RuntimeExce
       ption
        + FullyQualifiedErrorId : NullArray
    $web = Get-SPWeb http://tspmcwfe:89/
    $list = $web.Lists["test"]
    $item = $list.Items | Where { $_["Name"] -eq "Emc" }
    foreach($i in $items)
    IF($i["Title"] -eq $null)
             $i["Title"] = "test"
           $i.Update()
    adil
    Why are you piping a where in the items? Do you only want to add the "test" to ones matching
    a name?
    If you have ISE installed on your server I recommend you put your code in there and debug it. 
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • How to add 2 days to a date field?

    How to add 2 days to a date field if a Saturday was selected on a different date field?
    Thanks

    I am attempting to add a date field and then have a another field add an amount to a box if the date is less than 30 days. Later I want to update the form to have the today's date is less than 10 days.
    Early Registration Fee is $10.00 if posted by February 25, 2008
    Late Registration Fee is $20.00 if posted by March 17, 2008
    It seems simple, but, when you get to be 71 years old, it seems difficult. Any help will be appreciated.
    Here is a link to the form I'm working on:
    http://www.aworldwide.com/Gideon/Convention_Registration.pdf
    I am using a trial version of Adobe Acrobat 8.
    Thanks,
    Andy Anderson

  • How to add a day to Date() ( i.e 2002Oct10 to 2002Oct11 )

    Hi anyone, How to add a day to Date().
    <%
    String R, fulldate;
    java.util.Date Rdate = new java.util.Date();
    R = Rdate.toString();
    String DD=Rdate_string.substring(8,10);
    String MM=Rdate_string.substring(4,7);
    String YY=Rdate_string.substring(24,28);
    fulldate = YY+MM+DD;
    //ie. fulldate = 2002Oct10 but I want it to be 2002Oct11
    %>
    pls. help and thanks a lot.

    Hi,
    Please replace the following line in your program,
    String DD=Rdate_string.substring(8,10));
    with
    String DD=String.valueOf(Integer.parseInt(Rdate_string.substring(8,10)) + 1);
    This will work fine. Basically what this code is doing is that, it will get the Integer from the String, increment it by 1 and then change the integer to the String again.
    Hope this helps,
    Rajat,
    OTN Team

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

Maybe you are looking for

  • How do I run iMovie 11 from an external hard drive to save space on my iMac?

    I've recently bought a 1TB external hard drive (My passport) which I want to use exclusively for photos and movies. I've already successfully transferred all my iPhoto library to the external hard drive which is now the default for iPhoto. Can I do t

  • Script to Change WINS IP based on current address.

    Hello everyone! I've been looking online for help on changing the primary and secondary WINS addresses on hundreds of servers. I've come across scripts that will set the WINS addresses for all enabled NICS on servers listed in a .txt file. But I don'

  • Number of data files per database!

    Hello, http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/limits002.htm#i287915 reads >> Database files Maximum per tablespace Operating system dependent; usually 1022 Maximum per database 65533 May be less on some operating systems Limit

  • Unable to consistently keep XBOX Live party with multiple consoles from same location.

    I have FIOS (Actiontec MI424WR Rev E with firmware 20.10.7.5) and am having problems staying in a party when running two XBOX 360 consoles.  Both Xbox's are connected to the router wirelessly.   We often like to crreate our own party (of 2) and play

  • Upgrading from 10.3.9 to Tiger 10.4.6

    I would like to find out if there are any major issues in upgrading to the Tiger OS? What I'm concerned about is how the new OS will effect the functionality of my pre-intel software, as well as my pre-intel G5.