Difference between date

How to find a difference between two date in format 04/23/2003(mm/dd/yyyy)?

How to find a difference between two date in format
04/23/2003(mm/dd/yyyy)?Try this one:
         SimpleDateFormat formater = new SimpleDateFormat("MM/dd/yyyy");
         String date1 = "04/29/2003";
         String date2 = "04/20/2003";
         Date result1 = formater.parse(date1);
         Date result2 = formater.parse(date2);
         long diff = result1.getTime() - result2.getTime();
         System.out.println("Different: " +diff+" millisecond" );
         System.out.println("Different: " +diff/86400000+" days");Hope this is help :)
And don't forget:
import java.util.Date;
import java.text.SimpleDateFormat;

Similar Messages

  • What is difference between data base structure and stucure  in program

    what is difference between data base structure and stucure  declared in program  level . can  explain cleary if knows

    Hi,
    Data base structure is global decalaration you can reffer this structure in any of your developments, when ever you cahange this structure the changes automatically will get updated in all the programs.
    coming to structures in program it is local to your program only, if you want to change the structure again you have to open the program and do the necessary changes.
    Reward if useful.
    Thanks,
    Sreeram.

  • Difference between Data staging and Dimension Table ?

    Difference between Data staging  and Dimension Table ?

    Data Staging:
    Data extraction and transformation is done here.
    Meaning that, if we have source data in flat file, we extract it and load into staging tables, we take care of nulls, we change datetime format etc.. and after such cleansing/transformation at then end, load it to Dim/Fact tables
    Pros: Makes process simpler and easy and also we can keep track of data as we have data in staging
    Cons: Staging tables need space hence need memory space
    Dimension Table:
    tables which describes/stores the attribute about specific objects
    Below is star schema which has dimension storing information related to Product, Customer etc..
    -Vaibhav Chaudhari

  • Difference between date info object in characteristics and keyfigure

    What is the difference between "date" data type in characteristic and keyfigure?
    Thanks in advance.
    Raj

    Hi Rajasekhar,
    If date is characteristics,query can be analysed based on date and filters can also be set using this date.
    If it is key figure query cannot be analysed based on date,
    Based on requirements,we have to decide whether it should be chatracteristic or key figure
    Regards
    Prakash

  • Find difference between date

    I need to know how i can find difference between date
    like Joining date: 01-jan-2009 Today 10-jan-2010 result will be "1 year 10 days"
    I need it in Oracle forms 6i. plz help me...

    Hi,
    In oracle forms you can use
    RESULT :=
    TRUNC ((:date2 - :date1 + 1) / 365)
    || ' year and '
    || MOD (:date2 - :date1 + 1, 365)
    || ' days';
    in sql you can use
    SELECT TRUNC ((:date2 - :date1 + 1) / 365)
    || ' year and '
    || MOD (:date2 - :date1 + 1, 365)
    || ' days'
    FROM DUAL;

  • Counter KF with 1 & 0 and difference between data type NUMBER (DEC) and INTEGER (INT4)

    Hi,
    I need to create a counter kf which should populate 1 and 0 to this counter field. Please let me know is there any difference between data type
    NUMBER (DEC) and INTEGER (INT4).
    Please suggest.
    Thanks & Regards,
    Pavan kumar

    Hi Pavan,
    The basic difference between Number(DEC) and INT4 is its internal storage in system.
    For Number (DEC) - Value internally stored as packed number with 3 decimal places whereas INT 4 as 4 byte integer without decimal places.
    For counter KF, you can go for INT 4.
    Hope this helps.
    Thanks

  • Difference between data target & Infoprovider.

    Hi all,
    Difference between data target & Infoprovider.
    why cube is best in performance wise other than ods,multiproviders.
    Thanks,
    cheta.

    A data target is an object into which data is loaded. Data targets are the physical objects relevant during data modeling and when loading the data.
    Structure
    Data targets are:
    InfoCubes
    ODS objects
          InfoObjects (characteristics with attributes, texts or hierarchies).
    There are differences between:
    Pure data targets for which no queries can be created or executed. An InfoCube might only be used as a data source for another InfoCube. This is also possible for ODS objects and InfoObjects.
    If you want a characteristic to appear in the InfoProvider tree, you have to assign an InfoArea to it. You can define update rules for the characteristic in the InfoProvider tree, and use them to load attributes and texts.
    You can turn a characteristic into a data target only if the characteristic contains texts or attributes. It is not possible to use update rules to load hierarchies.
    Data targets for which queries can be defined. These are called InfoProviders.
    <Request for points removed>
    Regards
    Hemant
    Message was edited by:
    Moderator

  • Difference between Data Class and Delivery Class

    What is the Difference between Data Class and Delivery Class , what happens Phisically to the Data .
    Moderator message: what is the difference between your question and a question that we'd welcome here in the forums?
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Thomas Zloch on Nov 22, 2010 1:17 PM

    What is the Difference between Data Class and Delivery Class , what happens Phisically to the Data .
    Moderator message: what is the difference between your question and a question that we'd welcome here in the forums?
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Thomas Zloch on Nov 22, 2010 1:17 PM

  • Difference between Data Provider and extractor.

    Hi
    Can someone help me in understanding difference between data providers and data extractor.
    I have gone through some documents but not able to get the exact difference between them.
    What is the exact role of data provider and extractor with respect to sap solution manager.
    Is data provider== Data extractor?
    Thanks,
    Vijay

    Hello Vijaya,
    From my perspective the Data Providers are responsible for collecting metric values from the monitored objects on the managed sources systems and sending these to the Solution Manager Monitoring and Alerting Infrastrucure.
    Data extractors on the other hand are the reporting objects which are defined on the BW part of Solution Manager and can be enabled by configuring some monitoring scenario's. Once these data extractors are enabled, they will use the data from the "Data Providers" (see above) to setup nice BW reportings on the Solution Manager monitoring dashboards.
    I hope this answer helps you.

  • Difference between Dates: BW Query???

    Hello all,
    A.I have to get the difference between dates i.e Date1 and Date2.
    I have used a 2 formula variables for each one of them with Replacement path - Key - number as the settings.
    When i execute the difference between the 2 formula variables, i get inconsistent results if the dates are from 2 different months.
    Example(Correct Result)
    Date1 = 14.02.2005
    Date2 = 10.02.2005
    Result = 4
    Example(Incorrect Result)???????
    Date1 = 14.02.2005
    Date2 = 10.01.2005
    Result = 104
    Iam know that system is converting the date as a number like 20040214 and 22040110 and just substracts.....This is not correct....any solution to circmvent this problem???
    B.If iam using a user-exit for variables, how to pass the values Date1 and Date2 to user-exit so that i can calculate the difference of days using a function module.
    I know how to use a user-exit but not sure about working on 2 fields at a time for a formula variable????

    1) For the first problem, I think you should play with the replacement path settings (type, offset,...).  I did this before and I'm sure it worked.
    2) If the variables are entered in the variable screen there is no problem to use a function module (it works with steps --> look at the how-to), but I think you want to calculate not on variables but on the keyfigure values itself, in this case you will have to use virtual characteristics.  There is also a how-to about this, I can't help you with the details my self.
    kr,
    Tom

  • Difference Between data target and infoprovider

    Hi Experts,
    I am new to BW
    What is the difference between data target and  infoprovider
    Thanks and Regards,
    saveen

    Hi Saveen,
    InfoProvider is an object on which BEx queries are created. It provides information (data) to the queries when they are executed. InfoProviders may contain data (like cube) or may not contain data (like multiproivder and InfoSet).
    Data Target is an object to which you will load the data, like cube, ODS or InfoObject. But it is not necessary that each data target is an InfoProvider...like you may have ODS objects that are not enabled for reporting, but you are loading data to them for staging purpose.
    Hope this helps...

  • Whats  basic difference between data and types while declearing the itab

    whats  basic difference between data and types while declearing the internal tables...
    DATA : BEGIN OF t_vbap OCCURS 0,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
       END OF t_vbap.
    vs
       TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
       END OF t_vbap.
    and vs
      TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbeln,
    posnr LIKE posnr,
    kwmeng LIKE kwmeng,
    netpr LIKE netpr,
    netwr LIKE netwr,
    werks LIKE werks,
    matnr LIKE matnr,
    arktx LIKE arktx,
       END OF t_vbap.

    hi,
    like -> used for refering existing data elements in data dictionary or in sap
    type -> used for refering existing data types in sap.
    types: used for creating used defined structure of tables which has fields from more tahn one table.
    diff b/w types and type in creation of internal tables is that when u create a table with types then u can use same for work area creation also.
    ex:
    TYPES : BEGIN OF t_vbap,
    vbeln1 LIKE vbeln,
    posnr LIKE posnr,
    kwmeng LIKE kwmeng,
    netpr LIKE netpr,
    netwr LIKE netwr,
    werks LIKE werks,
    matnr LIKE matnr,
    arktx LIKE arktx,
    END OF t_vbap.
    data: itab1 type t_vbap
            wa_itab1 type t_vbap.
    when type is used then u have to create a defintion of work area for another time when internal table doesnt have headr line as
    ex:
    DATA : BEGIN OF t_vbap OCCURS 0,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
    END OF t_vbap.
    DATA : BEGIN OF wa_vbap,
    vbeln1 LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    kwmeng LIKE vbap-kwmeng,
    netpr LIKE vbap-netpr,
    netwr LIKE vbap-netwr,
    werks LIKE vbap-werks,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
    END OF wa_vbap.
    if helpful reward soem points.
    with regards,
    suresh.

  • What is the difference between data base objects and runtime objects

    What is the difference between data base objects and runtime objects

    Hi raja,
    data base objects means u can have the presence of these objects in the database.So the tables,searchhelps,structures,lockobjects comes under these ones.
    Runtime objects are created and destroyed after the program ends, any changes we make to them are temporary only.
    regards,
    nagaraj
    Message was edited by: nagaraj kumar nishtala

  • Difference between Data-centric and Document-centric use

    Hi,
    Can someone suggest what exactly is the difference between Data-centric and Document-centric use and examples if any.
    Thanks in advance.
    Chaitanya

    Maybe it helps if you look at it this way...
    Document centric: document centric use of xml data is data that you always use in its complete form. If you want to use the data, then you always will retrieve it as one entity or you save it as one entity. You are not interested in the xml data / information inside this "package" / document, you are only interested in its total form. Lets say, you have an invoice which can be printed on one sheet of paper. This paper that contains you data, will always be treated in a document driven way, that is, in its total representation: information containted on a sheet of paper (document).
    Data centric. data centric use of xml, is usage of data were the main interest point is focused on only pieces of the total set of xml data within a document. So instead of being interested in the whole invoice, you only are interested in information like "amount of money to be payed" or "invoicenumber".
    Handling of XML data comes with (hidden) costs. Knowing how your data will be used, has to be used, is one of the first steps in designing you environment (and will have an big impact if you choose poorly). For instance, if you know that your data will always be handled (and must be stored) in a document driven way, then it will make sense to store it based on CLOB based XMLType storage. This will garantee best performance retrieval for your xml document. If you now that your xml data has to be stored so that it can be handled in a data centric way, then Object Relational XMLType storage. If conditions are setup properly data retrieval, inserts and updates will be more cost efficient then when based on CLOB XMLType storage.
    There are more differences and "cost markers" when or when not to use CLOB, OR or for instance Binary XML. The first two chapters of the XMLDB Developers Guide for Oracle 11g will give you a good head start making some of those decisions. Be also aware that you probably will have to make compromises. The current state of XML, for example, doesn't have the final solution yet for a uniform storage method.
    Message was edited by:
    Marco Gralike

  • Difference between Data Source & Tx Data Source

    What is the difference between Data Source & Tx Data Source in Services->JDBC ?

    "David" <[email protected]> wrote:
    >
    What is the difference between Data Source & Tx Data Source in Services->JDBC?JDBCDataSource gives you Connection Pooling on top of plain JDBC functionality.
    JDBCTxDataSource gives you participation in JTS transactions on top of JDBCDataSource
    functionality.
    So if you want the connections to participate in your EJB transactions, you must
    use JDBCTxDataSource.

  • Difference between "Data replication", "Data Cloning", "Data duplication" and "Data Migration"

    Hi Gurus,
    Can anyone tell me the difference between "Data replication", "Data Cloning", "Data duplication" and "Data Migration". I have gone through Google but doesn't find any appropriate answer for that where I can find the difference.
    It would be highly appreciated if you give me a link for all and give me some point out.
    Thanks & Regards
    Nimai Karmakar

    Here is how I see the terms used and understood by most folks
    "Data replication"
    This is the keeping the same data in sync in 2 different databases.  Replication is the process of keeping data in sync between 2 environments/databases and not limited to Oracle to Oracle, it could be Oracle to MySQL to be kept in sync, MySQL to Oracle, Oracle to SQL Server, SQL Server to Oracle.  The purpose of keeping data in sync can vary, but that is basic description of what it is.
    "Data Cloning"
    Make a copy of the data/database from one database environment to another, like for example taking production database and cloning the database to a pre-production database/environment for testing.  Coning term is used more when copying a database not just data, but the whole database so typically you hear the reference "Database Cloning", but data cloning is basically the making a copy of the data from one place to another.  Sometimes Cloning and Duplicating are used in the same way by folks as the basic end result is the same you are making a copy of the data to someplace else.
    "Data duplication"
    This is typically term when duplicating the data from one environment to another for a particular purpose, a lot of folks use "Data/Database Cloning" and "Data Duplication" in the same context, meaning they use them to mean the same thing, but I see more difference in the terms so when they are different Data Duplication is done when combining 2 databases to 1 therefore you can not clone the 2 databases into one so this term would be used more in those circumstances.
    "Data Migration"
    Moving data from one location/database to another location database, for example moving from MySQL to Oracle you would do a data migration from MySQL to Oracle as you are moving the data from MySQL to Oracle and going to leave it in Oracle.  You could also be migrating to from Oracle 10g environment to a new Oracle 11g environment, therefore "Migration" is typically used when referring to moving the data from one environment to another and the source and target are different in location, database vendor, database version.
    These are very simple ways of looking at the terms from my experience on how they are used.

Maybe you are looking for