Need a help regarding date

Dear all,
SimpleDateFormat simpleDate = new SimpleDateFormat("dd-MMM-yyyy");
          Calendar calendar = Calendar.getInstance();
          int month = calendar.get(Calendar.MONTH);
          calendar.set(Calendar.MONTH, month-1);
          calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
          System.out.println("Previous Month End Date is :: " + simpleDate.format(calendar.getTime()));From the above code i am able to find the last month end date according to System date .
But how to find the last month end date of a userdefined date.
For example,user defined a date as '05-AUG-2009' how can i find the last month end date

Thanks all,
Hope this is the solution .
Any Suggestions will be appreciated
String dateString = "10/2009";
         StringTokenizer st = new StringTokenizer(dateString,"/");
         String dateStringm = (String) st.nextElement();
         int month = Integer.parseInt(dateStringm);
         String yearStringm = (String) st.nextElement();
         int year = Integer.parseInt(yearStringm);
         System.out.println("month :"+month);
         System.out.println("year :"+year);
         Calendar calendar = Calendar.getInstance();
         calendar.set(year, month,1);
         calendar.set(Calendar.MONTH, month-1);
         SimpleDateFormat dateFormat = new SimpleDateFormat("MM/yyyy");
         String previous_month_end_date =  dateFormat.format(calendar.getTime());
          System.out.println("Previous Month End Date is :: " + previous_month_end_date);
          Calendar cld = Calendar.getInstance();
          cld.set(Calendar.DAY_OF_YEAR,1);
          String year_start_date =  dateFormat.format(cld.getTime());
          System.out.println("First day of year is :: " +year_start_date);

Similar Messages

  • Hi friends.....i need a help regarding date manipulations

    I want to know that how can i get the week date ranges of a specified month.
    for example: the input is month = 6 and year = 2007
    i need the output as 01.05.07 - 07.05.07
                                  08.05.07 - 14.05.07
                                  15.05.07 - 21.05.07
                                  21.05.07 - 27.05.07
                                  27.05.07 - 30.05.07
    Waiting for your positive response.
    Kesavadas T

    parameters : month(2), year(4).
    data : date type sy-datum.
    data : last_date type sy-datum.
    data : day(2) value '01', last_day(2).
    data : from_date type sy-datum, to_date type sy-datum.
    concatenate year month day into date.
    CALL FUNCTION 'SG_PS_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        day_in                  = date
    IMPORTING
       LAST_DAY_OF_MONTH       = last_date.
    last_day = last_date+6(2).
    from_date = date.
    to_date = date + 6.
    while to_date <= last_date.
      write : / from_date, '-', to_date.
      from_date = to_date + 1.
      to_date = from_date + 6.
    endwhile.
    if from_date <= last_date.
      write : / from_date, '-', last_date.
    endif.
    This works fine. Hope this solves your problem.
    Regards
    Anil Madhavan

  • Need qucik help  regarding date

    Hi, I have table A which has column report_month
    its has values like 10/1/2012, 11/1/2012,12/1/2012
    I try to do the following, apparently both are not working, I just want to retrieve 11/1/2012
    select * from A ehere report_month like (11%)
    or
    select * from A ehere report_month like ('11%')

    Hi,
    949523 wrote:
    Hi, I have table A which has column report_month
    its has values like 10/1/2012, 11/1/2012,12/1/2012
    I try to do the following, apparently both are not working, I just want to retrieve 11/1/2012
    select * from A ehere report_month like (11%)
    or
    select * from A ehere report_month like ('11%')You mis-spelled WHERE.
    If report_month is a DATE (which is the most reasonable data type), then
    SELECT  *
    FROM    a
    WHERE   EXTRACT (MONTH FROM report_month) = 11
    ;will display rows dated November of any year.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Help regarding data element

    I need some help regarding data element ZEXPDT.  I used it in an infoquery that was transported to QAS and it does not exist in QAS.  I thought it might be locked in a transport, but the below screen clip says it is not locked.  It was created in 3/2014.  Thanks.

    Either trick the system, SE11, add a space at end of text desciption and save,
    Or call transport workbench (SE01, SE10) create a transport request or use an existing one, then double-click on a task, switch to modify mode, add a line with R3TR DTEL name of the data element, save, then object list, lock in request/task menu.
    Or SE80, contextual menu of data element. (other functions, write transport entry)
    Regards,
    Raymond

  • Hello I need a help regarding application passbook.I need know if I can download the application passbook as passbook.ipa?

    Hello I need a help regarding application passbook.I need know if I can download the application passbook as passbook.ipa?

    Passbook is an app that's built into the iPhone. It's not availble for the iPad.

  • Need urgent help regarding oracle 8.0

    Hi Guys!!
    This is vishal, and i am working as an oracle developer.
    I would appreciate your help if you could help me solving the below
    issue :
    Right now the database on which we are running our applications is
    8.0 version. We have oracle App server on which all of these j2ee
    applications are running.
    basically our client is trying to move large amount of data to a
    new database probably 10G, so my job is to analyse the code and
    do some modifications to the code, give them a solution to upgrade
    it to 10g
    There are like 10 applications running on oracle app server and the
    database has many old tables, and they need a suggestion regarding
    this upgradation/migration.
    And i specifically want to know about the problems faced during the
    upgradation, and how exactly is the upgradation done(step -by -step
    procedure), because i also have to take care of the data which
    has been stored from many years.
    thanks,
    Vishal

    I find these informations in the Upgrade Guide (upgrading of database and of application programs):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/toc.htm
    Note: direct upgrade from 8.0 to 10g is not supported using tools like DBUA (Database Upgrade Assistant).
    Werner

  • I need your help regarding Macbook Pro with FCS3 via USB

    Sorry for the double posting, I need your help...
    I am producing an independent TV movie. We are shooting in HDV with a Sony Z5.
    Currently I am using a 2007 iMac (1gb) for the FCS3. I am considering buying a Macbook Pro 15' i7, because I need the portability as well as a WD 1TB portable external drive.
    Just when I am about to buy the machine I started to read all about the USB vs. the Firewire. What should I do? The MBP only have one firewire port...if I use an USB portable external drive means that I won't be able to use FCS3 properly and that buying a MBP will mean spending money in something that I won't be able to make it work properly??
    Thanks for your help!!!!

    Hi there,
    As Patrick said its Firewire hubs you should avoid along with directly connecting your media drive via USB. USB hubs are fine for connecting peripherals (keyboards, tablets, mice etc). directly connecting USB media drives is not for streaming video due to their method of sending data in packets rather than as the continuous stream that firewire provides. Firewire hubs just seem to cause all sorts of headaches to those that have used them, I cant give you a specific reason other than splitting the available FW bandwidth (someone with more knowledge on this will have to chime in), its more just inherited practice.
    cheers
    ANdy

  • In urgent need of help regarding getting month name and dates

    Hi Experts
    I have a table called MONTHLYBILL with Column TRANSACTIONMONTH. I need one query / function / SP to do return ouput based on following combination. I am using Oracle 9i
    Have researched on various forums, documents but unable to get the desired output. Finally here in hope of help.
    Input
    From Date: 06/01/2011
    To Date: 12/03/2011
    Output
    Month: DECEMBER-2010 (previous month of From Date). Now if DECEMBER-2010 is not available in table, then returns the
    month which is available immediately the month preceeding DECEMBER-2010
    Begin Date: 01/01/2011 (1st day following the month returned in output)
    End Date: 31/03/2011 (last date of month based on input To Date)
    Input
    From Date: Null
    To Date: 12/03/2011
    Output
    Month: First available transactionmonth in DB (say JANUARY-2010)
    Begin Date: 01/02/2011 (1st day following the month returned in output)
    End Date: 31/03/2011 (last date of month based on input To Date)
    Input
    From Date: Null
    To Date: Null
    Output
    Month: First available transactionmonth in DB (say JANUARY-2010)
    Begin Date: 01/02/2011 (1st day following the month returned in output)
    End Date: Current month's last date

    What is your application release?
    I am in big trouble now.. can anyone help....
    I have a backup of an EBS instance, lets say it was taken one month ago, and now we got some datas lost in the current production server..
    some one deleted some datas...
    Now we need some specific data from the old backup and restore it to the production
    or can it be restored? please help me guys...What kind of data? What is the table name?
    Since this is a production issue, I would suggest you log a SR.
    Thanks,
    Hussein

  • Need some help regarding value date

    hiii experts...i want little clarification about value date and its effects... i searched scn and google but my issue is like...when we receive cheque today i.e 11/06/2014... it will be come in bank a/cs nearly on 14/06/2014... so if we write the value date 14/06/2014... will that bank ledger show effect on 14/06/2014... moreoveer the user posted a entry development server for 1/3/2014 and gave value date of 1/4/2014.. now in faglb03... how it will reflect..i know its basic question but i didnt find any solution through searching soo posted... please guide me..
    Regards
    Abhay

    hey mani... thankss for the reply... its shows the meaning which i understood but the effect in ledger... when it will show... value date or posting date??
    e.g
    a customer gives cheque today 11/6/2014.. user deposits cheque today and it will come into bank account near on 14/6.2014..
    IN SAP
    user does entry today i.e 11/06/2014
    in bank g/l... he gives value date 14/06/2014... now when he posts the entry... the entry will shown in ledger on 11/06/2014... but the actual amount will come in 14/06/2014... soo my question is ... whts the user of value date then if he is posting the document on posting date

  • Need your help regarding Conditional Chart Data formatting

    I have just started using BI, so I am sorry if what I am asking is a FAQ or a very simple question.
    I have a Line Bar Combo chart whose bars I have colored differently according to some conditions. When I drill down from a year/month series to the day of a particular month, though, the conditional formatting is lost.
    http://img141.imageshack.us/img141/5677/biimage.jpg
    Can anyone suggest me if I am missing something in the program options or if there is any workaround to this behavior?
    Thanks a lot in advance.

    Letz say you have colored the year black when it is 2008 and you display it in the graph and while you drill down from year to quarter in the back ground an adiitional column will be added (Quarter) and the conditional formatting will be still there for the year but will be very small(like a dot) as your quarter is exposed on the X axis.
    The deeper you drill the wider your x-axis will be and the smaller your formatting looks.
    You cant controll the drill. It will mimic what is present in the compound layout set up at the parent level.If you need to avoid multiple columns appearing on your X-axis and do some changes to your graphs then you need to navigate
    instead of drill. if the report is 3 levels deep then it has to be 3 diff reports(maintenance will be high)
    It will be seemless to the users whether you navigate or drill. Just a suggestion. There are some things which we need to compromise :)
    Thanks
    Prash

  • I need some help Regarding Cumulative totals

    Hi ,
    i have a requirement
    1) we have columns calender Periods and actual to date. The requirement is we need cumulate the actual to date. i have applyed RSUM function in column formula.
    2) it is working fine. But again the requirement is this cumulative solution is changed based on selected calender periods. but this is not expected.
    3) ex:-
    calender period actual Units Cumulative Units
    oct - 2010 10 10
    Nov-2010 9 19
    Dec-2010 15 34
    Jan-2011 25 59
    Feb-2011 12 71
    March-2011 19 90
    April - 2011 13 103
    May - 2011 18 121
    June - 2011 24 145
    this is the reqiurement but i have a Prompt Like
    i hve selected resource categery some xyz and stert period is Jan -2011 and end period is May - 2011
    the values disply's like bellow
    Resource Category start Period End Period
    xyz Jan - 2011 May - 2011
    Jan-2011 25 25
    Feb-2011 12 37
    March-2011 19 58
    April - 2011 13 71
    May - 2011 18 89
    But this is not actual cumulative units the actual value for Jan 2011 cumulative value is 59 not 25
    can any one help me regarding this issue
    regards,
    ramesh

    Hi,
    Refer this link abt iview properties & set authorization ...
    http://help.sap.com/saphelp_nw04/helpdata/en/13/81a66d100011d7b84b00047582c9f7/frameset.htm
    Color- you have to change portal theme...
    Width- create a new Loyout..
    Regards,
    Senthil K.

  • Need URGENT help on DATA PACKAGE

    Hi team,
    When we extract the data from the data source it's getting as a package by package before start process i need to add all the packages into one internal table .
    How do i do that ?.
    Pl help me it's URGENt appreciate your response. thanks.
    Regards,
    Senthil

    hi,
    you need to do the process in source system or BW.
    if it is in source system, extract through program/function module that coolects all the data package and process there and push to BW once procee is over.
    if it is to be done in BW- i hope in the start routine u can do only by package by package.
    please give ur actual requirment so that others can give suggesstion.
    Ramesh

  • Need some help with date

    Hi everyone!
    I have an application in Flex AIR and I'm having problems with dates, I could't found an example on internet until now.
    I tried this for insert (database is embeded sqlite)
    insertManager.parameters[":mydate"] = mydate.selectedDate.time; // type of this column is INTEGER (in my table) and store a number (milliseconds from 1/1/1970) ex: 1265079600000
    Then when I need read records
    mydate.selectedDate = new Date(mydateprice); //it supposed show me DD/MM/YYYY but in every case display 1/1/1970
    If I replace mydateprice for mydate.selectedDate = new Date(1265079600000); // it brings me the right date
    So I don't know what happed, and I'm not sure if it's the best idea to store a date in Flex AIR
    I'll appreciate any help, information or example to find a solution.
    Regards!
    Mara.-

    Thank you so much VIKASH!!! it works!!!
    Now I'm trying to format this value 1265079600000 in my datagrid column:
    <mx:DateFormatter id="dateFormatter" formatString="DD/MM/YYYY"/>
    <mx:DataGridColumn width="140" textAlign="left" headerText="DATE" dataField="myDateColumn" labelFunction="formatDate"  />
    public function formatDate(item:Object,column:DataGridColumn):String
    return dateFormatter.format(item.myDateColumn);
    but this column appear empty....
    Regards and thanks again!
    Mara.-

  • Need Desperate Help Regarding iPhone 4 Sync Issue (PC, Win7)

    I'll attempt to make this question as concise and fully informative as possible. I have an iPhone 4 Jailbroken running firmware v4.3.3. I typically sync my phone with my PC on a normal basis until this past October I bought a new SSD and had to re-install iTunes on my C drive. As you know, a re-install means that any re-sync with a fresh iTunes install means that the phone will basically wiped clean. Since the new iTunes install I have regularly been "Backing Up" the iPhone,(but never synced it) however this is not a "Sync" of course, but I figure it still beneficial to do. I believe I have the following options and/or issues to deal with:
    1) Is there any way to "reverse-sync" the iPhone to the PC, instead of the other way around? I kept the old iTunes operating files but I am not sure which ones I'd need to copy over to which folder to make a "current" sync happen, or to "fool" iTunes into thinking nothing has changed since the fresh install.
    2) I realize a "restore" will erase the jailbreak, but what if I choose "Restore From Backup", will that also erase or reset the jailbreak?
    3) I am mainly concerned with calendar appointments, my apps with invaluable information, and notes. Everything else such as music I can simply re-sync if I have to.
    In essence, I am trying to do a up-to-date sync with the new iTunes install and loose as little data and information as possible (or none at all). I have apps installed such as iFile that hold many files within the folder tree structure of the phone that I cannot afford to loose. I'd be willing to make backup copies of all these files if there is a viable solution for me, which Im hoping somebody can recommend to me.
    If there is a special app or PC app that I need to make things run smoother or achieve my goal I am more than happy to install whatever it takes. Thank you for any responses, they are most appreciated.
    I have attempted to be as detailed yet brief as possible with my explanation of the nature of my problem, yet feel free to ask a question if it will assist you in further diagnosing and solving my issue.

    Let's say I, at this very moment, "Backup" my phone in iTunes.  Once finished, I immediately perform a "Restore from Backup"
    There will be no change in your phone, assuming you didn't change anything or receive any messages between backing up and restoring the backup.  The phone will have exactly the content of what was in the backup.
    will iTunes have imported all saved phone data into its registry?
    It saves phone and app settings, messages, visual voicemail, contacts, Camera Roll, app data.
    such as apps, music, etc., since, remember, nothing is there now.  I need to put phone contents on the PC rather than the other way around
    No!!!!!   iTunes Store content (apps, music, media) is synced to and from iTunes - it's not in the backup. If you never synced your phone with this computer before, the first sync is  unidirectional from the computer to phone.  If there's nothing in the iTunes library now, what's in your phone will get deleted. In this case, you have to first "Transfer Purchases"  To do this:
    1. Be sure that automatic syncing on connection is disabled in iTunes Prefs > Devices > Disable.....
    2. Connect phone with iTunes open.
    3. Right-click the device tab on left border of iTunes window.
    4. Select "Transfer Purchases."  Note that any music/media on the phone that was not originally obtained from the iTunes Store will not transfer to the computer.
    It's now safe to sync the phone.  Note that when you select "Sync" on the iTunes page, the phone is typically backed up as well, if you didn't set it up to backup to iCloud instead.
    http://support.apple.com/kb/HT1766
    http://support.apple.com/kb/ht4946

  • Need urgent help regarding Adobe LC ES2 JBOSS Clustering

    Hi,
    Am trying to setup a Horizontal Cluster setup(with two nodes) for Adobe LiveCycle ES2 with Adobe preconfigured JBOSS 4.2.1 and MSSQL 2008(single instance running on one of the nodes).
    I have successfully completed till Installing LC ES2 Modules in both the nodes according to the "Configuring LiveCycle® ES2 Application Server Clusters Using JBoss" document.
    But now the problem is about the next step, which is "Configuring LiveCycle ES2 for Deployment". The steps in this section do not clearly talk about where to run the configuration manager tool, i mean on which node of the cluster as two nodes are different machines in my case as it is a horizontal cluster. But at step 20 of configuring LC ES2(page 45 of the above mentioned document) there's note which says "Note: You need to initialize the database against only one server of the cluster. Subsequent steps need to be performed on only this server as well."
    Now,
    i) Does it mean that till step 19 i will have to parallely run configuration manager tool on both the nodes of the cluster and at step 20 i will have to completely exit the configuration manager tool on one node(Say node A) and continue the rest of all the steps(till 46) only in the other node( node B ) ?
                                                                                    OR
    I will have to keep the configuration manager window open in both the machines and perform some steps say for example 20 to 25 only in one node(say node B ) and skip these steps in node A and resume from 26 in node A and complete till the end in both the machines ?
    ii) At step 16 of the same section theres a note which says "Note: The paths for pop3.jar and the JDK must be same on all nodes in the cluster.". Where will the pop3.jar be ? I cudn't find it anywhere in the installation media or in the server folders ?
    Please help me asap as am stuck with it for two days !!! Please let me know if you need any other details.

    Hi,
    Am trying to setup a Horizontal Cluster setup(with two nodes) for Adobe LiveCycle ES2 with Adobe preconfigured JBOSS 4.2.1 and MSSQL 2008(single instance running on one of the nodes).
    I have successfully completed till Installing LC ES2 Modules in both the nodes according to the "Configuring LiveCycle® ES2 Application Server Clusters Using JBoss" document.
    But now the problem is about the next step, which is "Configuring LiveCycle ES2 for Deployment". The steps in this section do not clearly talk about where to run the configuration manager tool, i mean on which node of the cluster as two nodes are different machines in my case as it is a horizontal cluster. But at step 20 of configuring LC ES2(page 45 of the above mentioned document) there's note which says "Note: You need to initialize the database against only one server of the cluster. Subsequent steps need to be performed on only this server as well."
    Now,
    i) Does it mean that till step 19 i will have to parallely run configuration manager tool on both the nodes of the cluster and at step 20 i will have to completely exit the configuration manager tool on one node(Say node A) and continue the rest of all the steps(till 46) only in the other node( node B ) ?
                                                                                    OR
    I will have to keep the configuration manager window open in both the machines and perform some steps say for example 20 to 25 only in one node(say node B ) and skip these steps in node A and resume from 26 in node A and complete till the end in both the machines ?
    ii) At step 16 of the same section theres a note which says "Note: The paths for pop3.jar and the JDK must be same on all nodes in the cluster.". Where will the pop3.jar be ? I cudn't find it anywhere in the installation media or in the server folders ?
    Please help me asap as am stuck with it for two days !!! Please let me know if you need any other details.

Maybe you are looking for

  • View an HTML Page in a object

    Hi to All, I have created a custom TAB in a CRMD_ORDER. I want add a html page(external link) in custom container (like a browser). On the forum I did't find anything, can you help me? Best regards. Umberto

  • How to get the date of 60 days before 1999/03/01?

    Hi, I have a question about Date and GregorianCalendar here. I have a string "1999/03/01" and I would like to know the date that 60 days before 1999/03/01. What should I do it? I only went this far: DateFormat dateFormat = new SimpleDateFormat("yyyy/

  • Intel VT in the Bios of Satellite P200-13F disabled?

    Hi, I just bought a toshiba Satellite P200-13F and now I am finding out that the Vitrualization cannot be switched on in the BIOS. Can anyone tell me if Toshiba is planning to release a BIOS with this feature supported? I want to use the machine for

  • Trying to rebuild aperture library using Masters

    I have been having a problem with my photos for months now. Some have disapered and some have just gone crorupt. Made an appointment at the genuis bar and they told me i need to rebuild the library using the masters file on my back up drive. I attemp

  • Package not moved but assigned objects moved to quality.

    In our project, Transport request containing the Package creation is not moved to Quality system, but Classes/Webdynpro components/programs assigned to that Package is moved to quality through different Transport request without any errors. Strange p