How do you show the number of days per month?

How do you show the number of days per month?
I am working on a budget.  I want to know how much to amortize each month to fund an investment.  Income comes monthly, but expenses leave in days, or weeks.  The number of days and weeks in months vary. 
I want to figure out income and expenses per day, per month and per year, so I know how much can be invested each month, week or day.  For a start I would like a formula that shows how many days are in each month?

thanks..
I solve my problem as
public class MyExample {
    public static void main(String a[]) {
        String stdate = "2009-03-01";
        java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
        java.sql.Date preDate = java.sql.Date.valueOf(stdate);
        System.out.println(currentDate);
        System.out.println(preDate);
//        int dateCom = preDate.compareTo(currentDate);
//        System.out.println(dateCom);
        long diff = currentDate.getTime() - preDate.getTime();
        int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
         System.out.println(days);
}

Similar Messages

  • I wanted to know how do you calculate the number of days between two dates

    i wanted to know how do you calculate the number of days between two dates in java ? i get both the dates from the database. i guess there are many issues like leap year and Febuary having diff no of months ..etc.

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • Create a field routine to calculate the number of days per month

    Hi Experts,
    I need to create a field routine to count the number of days per month based on 0CALMONTH. Could you give me some inputs on how to do it?
    Thanks!

    Hi,
    Create InfoObejct and then insert it in InfoSource/InfoCube/DSO then write simp,e code for that based on your  0CALMONTH values.
    You just copy and pas this in SE38 and see the result and implement for your requirements.
    REPORT  ztest1.
    Data: zsydt type sy-datum,
          zd(2) type n,
          zm(2) type n,
          zy(4) type n,
          zcmnth TYPE /bi0/oicalmonth,
          znds TYPE /osp/dt_day.
          zsydt = sy-datum.
          zd = '01'.
          zm = zsydt+4(2).
          zy = zsydt+0(4).
          CONCATENATE zy zm zd INTO zsydt.
          CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
                EXPORTING
                  iv_date = zsydt
                IMPORTING
                  ev_days = znds.    "No.of days in month.
          write:/ zd.
          write:/ zm.
          write:/ zy.
          write:/ zsydt.
          write:/ znds.
    Thanks
    Reddy

  • How can you lower the number of days in IOS8 iPhotos deleted

    In IOS8 photos deleted stay for 30 days. Can you lower the number of days?

    To answer your Subject (rather than the body of your post)
    To get the number of controls, and refs to each, etc, you can combine a
    couple of example VIs and a little index finger grease to make a VI that
    does what you want:
    Help menu >> Find Examples
    Find Example Dialog >>Browse tab
    Programmatically controlling VIs
    Manipulating Applications and VI settings
    Edit Multiple VI Setups.vi
    New Examples for LabVIEW 6.1
    Queues
    Queue Control Seek.vi
    If these two VIs are put in a mixer and shaken (not stirred) you might come
    up with something that tastes write.
    Mike Ashe
    "GL" wrote in message
    news:[email protected]..
    > I need to convert llb from 6i to 6.1 and I am unable to, I beli
    eve
    > because I have to many controls and indicators in the llb.

  • How do you show the number of emails in Mail folders?

    Hi,
    I'm a little lost with the new Mail format.
    It was really helpful for me to know the number of emails that were in my Mail folders - it used to tell me at the top. But since I upgraded to Yosemite, I don't see that as an option. Can someone tell me - is there a way to make this feature come back?
    Thank you!
    Bob

    I've never seen "1 of XX" in OS X that I can recall. Often, iOS will show that.
    In OS X, typically, you'll see the number of messages in the titlebar (i.e. Unread (22 messages)). However, there seems to be an issue that if you view a smart folder, when you go back to the Inbox, you don't see the number of messages anymore. If you quit and restart Mail, the number appears. Perhaps that's what you're seeing?

  • I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for

    I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for.

    StevieJ wrote:
    I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for.
    Check Mail Preferences, Accounts tab. Select the account, then the Mailbox Behaviors tab. See if you have it set to Permanently erase deleted messages when: One week old. (or less)

  • How do you increase the number of messages retained in your inbox?

    How do you increase the number of messages retained in the inbox?

    settings - mail - email account - mail days to sync - choose the desired option.

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How do you return the number of Rows in a ResultSet??

    How do you return the number of Rows in a ResultSet? It's easy enough to do in the SQL query using COUNT(*) but surely JDBC provides a method to return the number of rows.
    The ResultSetMetaData interface provides a method for counting the number of columns but nothing for the rows.
    Thanks

    No good way before JDBC2.0. u can use JDBC2.0 CachedRowSet.size() to retrieve the number of rows got by a ResultSet.

  • How do you change the time of day presets in ical?

    How do you change the time of day presets in ical?  I would like them to be only 1 hour difference, with the preset start times of 10:00 am and end time of 6:00 pm, if I have anything starting after 4:00 pm it also changes the date to the next day.  Incredibly annoying!

    Hi there jenni6,
    It looks like this is possible in the Calender prefernces. Take a look at the article below for more infromation.
    Calendar (Mavericks): General preferences
    http://support.apple.com/kb/PH14994
    -Griff W.

  • How do you regulate the number of emails that are kept on your phone before they are deleted?

    HOW DO YOU CHANGE THE NUMBER OF EMAILS THAT ARE KEPT ON YOUR PHONE BEFORE YOU DELETE THEM?

    Your carrier sets this by time, not the number of "rings" since different ring tones take different times/ring.  The typical setting is 30 seconds, sometimes up to 40 seconds.  Contact your carrier to shorten it.

  • TS3899 In ios7 how do you limit the number of emails downloaded from your ISP server?  Previous version allowed you to limit it to 50, 100, etc.

    In ios7 how do you limit the number of emails downloaded from the ISP server?  Previous version allowed you limit the download to the last 50, 100, etc.

    Hi,
    Unfortunately, this is a feature that Apple have taken away.
    The best way to let them know you want it back is via http://www.apple.com/feedback/
    Regards

  • How do you limit the number of emails that download in ios7?

    How do you limit the number of emails that download in iOS7? In previous versions, I was able to limit (i.e. 50/100/ etc), the number that would download to my phone at any given time - other than new emails. Past/old emails would only be reloaded if I deleted newer ones or I requested more be loaded.

    Now solved:
    https://discussions.apple.com/thread/5325394?tstart=0
    Guy in my thread fixed it for me. Very simple to do.

  • How do you control the number of rings before voic...

    When people call me, Skype rings far to many times before voice mail comes on.  How do you reduce the number of rings on an inbound call, so that voice mail comes on in 4 to 5 rings?

    Hi, billwalker1125,
    Skype does not determine when to send calls to voice mail by the number of rings, but instead by the amount of time that has elapsed.  Check your settings (in Windows, it would be Tools -> Options -> Calls -> Voice Messages -> Start recording a voice message if ...   Remember to Save your changes!
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • How do you adjust the number of rings before the incoming call goes into voicemail?

    How do you adjust the number of rings on the iphone before the incoming call goes into voicemail?

    Set by your carrier, so contact them.

Maybe you are looking for

  • Auto-upgraded to itunes 6.0.5 - crashes ever since

    I auto-upgraded to itunes 6.0.5 - crashes ever since. I have - corrected preferences, restarted, closed all other programs, restarted. Tried to re-install itunes with fresh copy downloaded from your site. On re-installation dialogue box says the thre

  • Add Days to a Date field

    Hi all, I have the following requirement: I have a date field 0calday and the user would like to add a specific no.of days to it, like for example 10 or 15 days. Then we use this computed date field in calculations in the query. Could you please help

  • IOS 5.1.1 update apple composite av cable

    Updated to 5.1.1 on iPhone 4s and noticed when I plugged the Apple AV composite cable, the phone says it's not an authorized device and won't allow charging. Anyone else have this issue?

  • Form personalization requirement

    Hi All, I have a requirement where we need to throw error (or disable delete option) message if a user tries to delete a particular element (loan) which has been processed once either in regular payroll run or quick pay. (in element entries screen: A

  • Can't sync properly after 4.5 upgrade

    I have a Pearl 8100 and just upgraded to v 4.5. I didn't know anything about vendor-specific upgrades and just upgraded directly from Blackberry.com. Now when I try to synchronize (I use Outlook 2003 via Desktop Manager v4.2.0.14) it wants to add all