"Simple" date questions

Hi!
Can anyone help me with some questions regarding Date and Calendar(GregorianCalendar)?
How do I find the number of days in a month?
How do I find the number of weeks in a month?
(I'm making a calendar... ;)
In advance, thanks!!
JB

Hi!
Can anyone help me with some questions regarding Date
and Calendar(GregorianCalendar)?
How do I find the number of days in a month?What month? Presumably you mean for any given month and year.
- Construct a date for a given month using '1' for the day of the month.
- Create a calendar
- Use setTime() on the calendar to set it.
- Use getMaximum(Calendar.DAY_OF_MONTH) to get the last day
>
How do I find the number of weeks in a month?
No idea because "week in a month" is an ambigous term...
Full weeks? Does a single day count as a week? Does a week start on sunday, monday, saturday, etc?
If the start day doesn't matter. Then full weeks is "days in month"/7 and partial weeks is ("days in month" + 6)/7

Similar Messages

  • Simple date question

    Hi Experts,
    I do not know ABAP which explains my straight forward question.
    I am coding in BI.
    Based on an invoice date, I need to work-out the fiscal year.
    If the month of the invoice date is >= 4, then the fiscal year, is the current year.
    If the month of the invoice date is jan-march, then the fiscal year, it the current year-1.
    Thank you.
    PY

    data: gs_month(2) type c.
    gs_month = gs_invoice_date+4(2).
    if gs_month GE 4.
    gs_fiscal_year = sy-datum+0(4).
    elseif gs_month between '01' and '03'.
    gs_fiscal_year = sy-datum+0(4) - 1.
    endif.
    Greetings,
    Blag.

  • 4 Simple Flash Questions that Are Stumping Me!

    What is the Frame Rate for Web Animations
    Q1. I am making an animation which will be played on the web. What is the default frame rate (fps) of Flash CS5? And what is the frame rate of for web?
    Q2. My animation needs to be 30 seconds long. So at 15 fps that would mean I need to use 600 frames in Flash?
    How Do I Mask everything so all I see is the Content on the Stage?
    I have a wide image that extends past my movies stage size so when I preview my movie the image is visible. How do I mask out anything that extends past my movies window size? I believe I can create a layer named "mask" and place it above all other layers, but I forget how to make the mask. Any help is appreciated.
    How to Fade a Graphic
    I have a graphic element (some type) and I want it to fade from 0% to 100%. In older versions of Flash I could just select the symbol and then set it's alpha value to 0%, move a few keyframes and then set the alpha to 100%. Voila! but now it doesn't seem to work that way. How can I do this in CS5?

    Ned, it says 24 fps which means there is 24 frames per second so each 24 frames is 1 second.
    Date: Fri, 4 Nov 2011 05:35:16 -0600
    From: [email protected]
    To: [email protected]
    Subject: 4 Simple Flash Questions that Are Stumping Me!
        Re: 4 Simple Flash Questions that Are Stumping Me!
        created by Ned Murphy in Flash Pro - General - View the full discussion
    1 You can create your character as a movieclip and copy/paste that movieclip from one file to another. 2. One way to create a movieclip is to copy all the frame of the animation's timeline (select them all, right click the selection, choose Copy Frames), then create a new movieclip symbol (Insert -> New Symbol...etc) right click on its only keyframe and chhose Paste Frames.  THat will put all the layers and frames you copied into the movieclip The only way to come close to being certain about the timing of you animation is to use code to keep track of the time, something like getTimer()..  The frame rate that a file plays at is not a reliable means of dictating the time it takes due to a variety of factors which include the amount of content you are trying to process and performance limits of the user's machine.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4007420#4007420
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4007420#4007420. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Simple Date parsing Error

    Hello,
    I have used Simple Date extensively and have recently found what I think may be a bug.
    The API says that any string or character can be ignored in the input pattern by simply putting single quotes around it.
    If I have a date in raw format as follows: 2007-07-19T08:00:00
    I can use the input format yyyy-MM-dd'T'hh:mm:ss to parse this raw format above correctly. The single quotes around the T ignore this character in the parsing. This is fine.
    However, now I have a new raw format I have to deal with, it appears like this: 2007-07-19 08:00:00Z
    Now, SimpleDate handles the space just fine, however when I try to use this pattern, SimpleDate complains it cannot parse it.
    yyyy-MM-dd hh:mm:ss'Z'
    I have tried with many different characters and configurations but it seems there is a common bug here. If there is a character that is surrounded by single quotes at the END of the pattern, SimpleDate throws an exception.
    My question is should I be able to add ignored text in single quotes at any point in the pattern? Or are certain areas of the pattern off limits like the very end of the pattern?
    Thank you in advance for your response.
    TR

    jverd,
    Further research showed our app was running in J#. Run the command calls directly worked fine for each example. I am looking into how our app translates the text entered in the input field. Thank you for testing though.
    TR

  • Regarding simple date format

    Hi,
    Can any one please tell what is simple date format for below format.
    2008-11-04T11:49:04.312-04.00

    Basil wrote:
    I think all are getting confused with my question, I dont want to know how to convert date
    to a a particular format, I want to know if there is any format for 2008-11-04T11:49:04.312-04.00
    like yyyy-MM-dd'T'HH:mm:ss.SSS for 2008-11-04T11:49:04.312. My JDK version is 1.4
    Edited by: Basil on Nov 4, 2008 7:43 AM
    Edited by: Basil on Nov 4, 2008 7:43 AMRead the link for SimpleDateFormat and make one. How is that hard to understand? And it is what you have been being told from the beginning, and would have realised had you actually read the API docs pointed to. All the information you need to do so is there.

  • A few simple Logic questions...please help.

    I have a few probably simple Logic questions, that are nonetheless frustrating me, wondering if someone could help me out.
    1. I run Logic 8, all of the sounds that came with logic seem to work except organ sounds. I can't trigger any organ sounds (MIDI) on Logic, they won't play. I have a Yamaha Motif as my midi controller.
    Any idea why?
    2. I've starting running into a situation where I will record a MIDI track, the notes are recorded but they won't playback. The only track effected is the one that was just recorded. All other midi tracks playback.
    I have to cut the track, usually go out of Logic and back in, re record for it to playback properly. Any idea why this may be happening?
    3. How important is it to update to Logic 9. Are there any disadvantages down the road if I don't upgrade. If I purchase the $200 upgrade, do I get a package of discs and material, or it just a web download.
    Any help is appreciated!
    Colin

    seeren wrote:
    Data Stream Studio wrote:
    3) You get a full set of disks and manuals.
    They're including manuals now?
    I think his referring to the booklets ...on how to install etc
    It would be great to see printed manuals though ...I love books especially Logic/Audio related !!
    A

  • Simple data extraction reports by SAPu2019s SQL

    Hi,
    Can you please let me know how can I develop simple data extraction report using SAP's sql.
    Regards,
    Koushik

    HI,
    I have to do a PoC on Data Quality checks. In which there will be few reporting tables. One will be daily agreegate, one weely agreegate etc. Now I have to show those the data in form of reports. and Option is also required to drill down and drill up for those reports.
    Please let me know if I am able to clarify my question or not.
    Regards,
    Koushik

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • Dynamic Drop Down creation using simple data types

    Hi all,
    I have got a requirement in which i have to create an iView which is going to have 6 drop down values and with in that 1 value is going to have sub values which needs to get displayed in the similar drop down fashion.
    I have created a simple data type having enumeration of the 6 values and linked the same to iView with drop down by key which is working successfully. And for the purpose of sub values i have created a similar simple data type with two values and linked the same with a value attribute.
    Well, can any one tell me the further process to proceed ?
    Thanks in advance ...
    Vipin

    Vipin,
    There are quite some steps to achieve what you need. Since you have both your DropDownByKey elements defined and bound to context elements, it may make sense to keep the Second DropDownByKey element invisible and make it visible only when user selects a specified key from first DropDownByKey. To achieve this, follow these steps.
    1. Create an action with a parameter "key" of type string.
    2. Bind this action with onSelect event of your First DropDownByKey UI Element.
    3. Do mapping of parameter "key" in your wdDoModifyView with following code.
      if (firstTime)
             final IWDDropDownByKey dk = (IWDDropDownByKey)view.getElement("DropDownByKey1");
               // Replace DropDownByKey1 with id of your DropDownByKey Element.
             dk.mappingOfOnSelect().addSourceMapping("key", "key");
    4. Create a context attribute of type WDVisibility say "DDVisible" and bind to "visible" property of your second DropDownByKey.
    5. Set DDVisible to NONE in wdInit().
    wdContext.currentContextElement().setDDVisible(WDVisibility.NONE); 
    6. In onSelect action write this code to make second visible
    if(key.equalsIgnoreCase("Two")){
         //Replace "Two" with your required value.
             wdContext.currentContextElement().setDDVisible(WDVisibility.VISIBLE);
           else{
                wdContext.currentContextElement().setDDVisible(WDVisibility.NONE); 
    This should give the desired results.
    Hope this helps.
    Vishwas.

  • Simple Date Format

    Hi,
    I have an entity object with some attributes, one of them is called "CREATED_ON", which i have specified as a history column (created on).
    I have specified a format type of Simple Date in my Control hint and a format of dd-MM-yyyy. I then created a view based on my entity and dragged the view as an adf creation form. I also dragged a commit button to commit my record.
    However, the date that is stored in my database have a non-zero time component (e.g. 10-JUL-2007 10:46:22). This is a problem becuase in my search form, the search criteria does not work (it requires the exact time also to work). I do not want to use TRUNC in my SQL query.
    Instead i want the date to be stored with the format mask that i have specified.
    Can you please help me?
    Thank you

    Do you really want to lose the time component altogether, or just make the query on date-without-time work?
    There would be no way of recovering the information about when during the day the row was created if you truncate the time information, but it's possible to achieve if that's what you want. Both are possible to achieve.
    To achieve the "losing the current time info forever" approach, add the following overridden method in your entity impl class that slightly changes the way the history attribute value is returned, in my case, for the HIREDATE attribute of an Emp example:
        protected Object getHistoryContextForAttribute(AttributeDefImpl attributeDefImpl) {
            Object ret = super.getHistoryContextForAttribute(attributeDefImpl);
            if (attributeDefImpl.getIndex() == HIREDATE) {
                ret = new Date(new java.sql.Date(((Date)ret).getValue().getTime()));
            return ret;
        }To achieve # 2 instead, just add a SQL-derived attribute to the view object with formula:
    TRUNC(HIREDATE)and then use that sql-derived attribute in the query form instead of the normal HIREDATE attribute.

  • What can be considered as the business logic of simple data entry form

    Hi all,
    I want to separate my applications logic into layers. It is a simple data entry form and doesn't contain any complex business logic. So I want to get this simple business logic to different layer. But the problem is, I cannot clearly identify what are business logic of this kind of simple data entry form.
    How do I separate business logic of this simple data entry form to another layer?
    any help is appreciated,
    Thanks in advance,
    Dil.

    dcminter wrote:
    It is a [form] and doesn't contain any complex business logic. So I want to get this simple business logic to different layer. But the problem is, I cannot clearly identify what are business logic of this kind of [form].Are you asking which bits are business logic?
    Suppose that the data comes into your system immaculate from some external system. Imagine that it will go out into some other system. The bits that you would still have to write are your business logic.That's a nice practical definition. Thank you, I'm stealing it.
    Also interesting to note that validation falls into that category... say you're recieving data from a magical external source... you still have to validate it.
    And of course you'd still have to store it somewhere, ans retrieve it.
    Yep, I definately like that definition.
    Cheers. Keith.

  • Simple Data Base Program for Mountain Lion

    Does anyone have a recommendation for a simple data base program that will import comma delimited fields from early versions of Filemaker Pro (v 3.0, v5.0)
    The ability to import Filemaker Templates and Layouts would be a big plus.
    I do not need the a highly sophisticated program just something with the ability to import data from several different data bases and create layouts that look like I want them to look.  
    Also what is the earliest version of Filemaker that will run well on Mountain Lion ?
                                                                            Thanks....Ken

    I suggest Bento (by Filemaker), simple database, imports Filemaker Pro files and doesn't cost very much

  • Simple performance question

    Simple performance question. the simplest way possible, assume
    I have a int[][][][][] matrix, and a boolean add. The array is several dimensions long.
    When add is true, I must add a constant value to each element in the array.
    When add is false, I must subtract a constant value to each element in the array.
    Assume this is very hot code, i.e. it is called very often. How expensive is the condition checking? I present the two scenarios.
    private void process(){
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             if (add)
             matrix[i][ii][iii][...]  += constant;
             else
             matrix[i][ii][iii][...]  -= constant;
    private void process(){
      if (add)
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             matrix[i][ii][iii][...]  += constant;
    else
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
           matrix[i][ii][iii][...]  -= constant;
    }Is the second scenario worth a significant performance boost? Without understanding how the compilers generates executable code, it seems that in the first case, n^d conditions are checked, whereas in the second, only 1. It is however, less elegant, but I am willing to do it for a significant improvement.

    erjoalgo wrote:
    I guess my real question is, will the compiler optimize the condition check out when it realizes the boolean value will not change through these iterations, and if it does not, is it worth doing that micro optimization?Almost certainly not; the main reason being that
    matrix[i][ii][iii][...]  +/-= constantis liable to take many times longer than the condition check, and you can't avoid it. That said, Mel's suggestion is probably the best.
    but I will follow amickr advice and not worry about it.Good idea. Saves you getting flamed with all the quotes about premature optimization.
    Winston

  • Simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3

    Hallo
    Anybody knows about the use of Enumeration for simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3?
    I've defined an attribute "status" for the Entity "Project" with the following values
    0: NEW;
    1: ACTIVE;
    -1: INACTIVE. 
    As you see the data type is short.
    In the program I want to use the following code:
    Project myProject = new Project();
    myProject.setStatus(Status.NEW)
    But I found it out, it is inpossible to to use Status.NEW.
    On the other side I read the article of https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/085098ea-0c01-0010-12a8-80ac838bec85. This article is again not updated with the version 7.1 SP 3.
    I cannot understand about the whole changes. In the previous release we can define a DDIC type and use it as Simple Data type and in the new Release we just use the XSD-Facet to define an enumeration, but the problem is: we can not reference it in the program. I don't see any advantage.  And I tried to find out how I can define the attibute using DDIC type. I didn't get it.
    Thanks for any Hints!
    Kind Regards!
    Ping

    Hi Oliver,
    Thanks for the reply!
    I have login into the system, using User Id and Password.
    I have tried unsinstalling everything but the result remains the same.
    Previously only one service SAPCE_01 was showing up in the services explorer. But when I tried the
    Instance 00:
    sc create SAPRKT_00 binPath= "C:\usr\sap\RKT\SYS\exe\uc\NTI386\sapstartsrv.exe pf=C:/usr/sap/RKT/SYS/profile/CE1_SCS00_xxxxx" start= auto obj= "NT AUTHORITY\LocalService" password= abcd1234
    Instance 01:
    another service SAPCE1_00 was created. But when I tried to retry the instlattio, the installation again stopped at the point while starting the service and when I tried to retry it terminted with the following error.
    Please guide.
    sapinst.exe - Application Error
    The instruction at "0x00cbf040" referenced memory at "0x0072006d". The memory could not be "read".
    Click on OK to terminate the program
    Click on CANCEL to debug the program
    Selfextractor error
    iaextract.c:888: child has signaled an exec error. Keeping directory C:/DOCUME1/I047488/LOCALS1/Temp/sapinst_exe.1448.1196681060
    OK  
    Manish

  • Issues in Simple Data Type - Float

    Hi SDN,
    I have created a simple data type of float and assigned to a context attribute. I have mentioned that  the minimum and maximum inclusive value for the float as 0.1 and 29.9. This is assigned to a field aaa. When the page loads for the first time, there appears 0 by default and if I dont edit the field and try saving, it doesnt throw any error message. It accepts the value which was very strange to me. But if I edit the value and put as 0.0, it throws error message saying, the acceptable value for the field is between 0.1 and 29.9.
    What should I do to resolve this issue? Also Can I make the field empty instead of a zero appearing the field?
    Regards,
    Ganesh N

    Hello Ganesh,
    Whatever the value you have provided only that values are allowed in that input field. if the value is 0 or 0.0 you can validate that attribute and throw an error message that "The Value should not be 0".
    Regards
    Nizamudeen SM

Maybe you are looking for

  • After creation of PO system should not allow to change the price in PO

    Hi There, In my scenario once PO is created then after send to vendor PO print document,Users are changing the price in PO.so system should not allow to change the price in PO once PO got saved. So please advice.

  • Need clarification on the concept of "reset logs"

    Hi, When the database is in Archive log mode and once crashed will be recovered using the below command : SQL> startup nomount SQL> Alter database recover automatic using backup controlfile until cancel; Once the database is recovered, we give the be

  • Amemdments in purchase order

    Dear all,      Is there any standard reports in sap to check the amendments in purchase order. If so how?. I just need to compare the old values and new values in that particular purchase order. with regards, Edamanayil..

  • Unable to refresh filters from planning desktop(9.2.x)

    Hi i am unable to refresh filters from planning desktop.ie when a refresh is performed i get a popup with alist of users for which the filters didnt get updated and also the application goes into locked state. I feel this is mainly due to the existen

  • JDev 11g TP4 Issue - Cannot Open TP3 Database Class Diagrams

    I created the diagram with build 4893 (actually post TP3). After opening the application in TP4, double clicking the diagram (or selecting Open from the right-click menu) does not open it. The release notes web page seems to be down at the moment so