How do i parse a date binding into day month year

<c:set var="test" scope="page" value="${bindings.StartDate1}" />
how do i pars off individual day month and year values so i can load them
into text boxes?

use calendar insteed of date...
the difference is easy to find out:
long diffInMillis = calendar1.getTimeInMillis() - calendar2.getTimeInMillis()
hope this helps..
visit >> http://www.menzsoft.ch <<
rgds
chris

Similar Messages

  • How can I set the data binding between Web Dynpro & Database table

    Dear friend,
    I am a beginner of Web Dynpro. I want to develop my simple project like these:
    1. Create my own database table via Dictionary Project such as TAB_USER and have 3 fields: USER_ID, USER_NAME, USER_POSITION and I have already deployed & archived it.
    2. Create my own Web Dynpro Project, and create the input fields as User ID, User name, User position and icon 'Save' on the selection screen and I have deployed it already.
    For the process, I want to input data at the screen and save the data in the table, please give me the guide line like these:
    1. How can I set the data binding between Web Dynpro and Database table ?
    2.  Are there any nescessary steps that I will concern for this case?
    Sorry if my question is simple, I had try  to find solution myself, but it not found
    Thanks in advances,
    SeMs

    Hi,
    You can write your own connection class for establishing the connection with DB.
    Ex:
    public class  ConnectionClass {
    static Connection con = null;
    public static Connection getConnection() {
    try{
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/TSPAGE");
    con = ds.getConnection();
    return con;
    }catch(Exception e){
    return null;
    You can place the above class file in src folder and you can use this class in webdynpro.
    You can have another UserInfo class for reading and writing the data into the DB .
    Regards, Anilkumar
    PS : Refer
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
    Message was edited by: Anilkumar Vippagunta

  • How to convert Date format into day in ssrs reports?

    Hi
    How to convert date format into day?
    10/01/2010 as like Monday like that?

    =weekdayname(datepart("w",Fields!mydate.Value))
    -Vaibhav Chaudhari

  • Converting date into day of year

    I'm trying to write a program that prints the day of the year, given the date is in "month day year" form ie: 1 1 05, is day number 1 and 12 25 05 is day number 359.
    the program should also check for a leap year.
    I found this in a Google search and it's rediculously close to what i'm looking to achive, but instead of "today's date" i need it to read a day that was entered using Scanner or JOptionPane... and it would have to be in the above format when being entered.
    import java.util.Calendar;
    public class CalendarExample
    public static void main(String[] args)
    Calendar cal = Calendar.getInstance();
    int day = cal.get(Calendar.DATE);
    int month = cal.get(Calendar.MONTH) + 1;
    int year = cal.get(Calendar.YEAR);
    int dow = cal.get(Calendar.DAY_OF_WEEK);
    int dom = cal.get(Calendar.DAY_OF_MONTH);
    int doy = cal.get(Calendar.DAY_OF_YEAR);
    System.out.println("Current Date: " + cal.getTime());
    System.out.println("Day: " + day);
    System.out.println("Month: " + month);
    System.out.println("Year: " + year);
    System.out.println("Day of Week: " + dow);
    System.out.println("Day of Month: " + dom);
    System.out.println("Day of Year: " + doy);
    this if for a begining level java class, and I have no idea where to get started. Any help would be appreciated.

    End result
    import java.util.Scanner;
    public class dayoftheYear
         public static void main(String[] args)
              //Declare variables
              int day, month, year, doy=0, Jan=31, Feb=28, Febleap=29, Mar=31;
              int Apr=30, May=31, Jun=30, Jul=31, Aug=31, Sep=30, Oct=31, Nov=30, Dec=31;
              //Description
              System.out.println("************************************************************");
              System.out.println("This application will"
                                  + " use input for month and day "
                                  + "\nto determine what day of the year "
                                  + "it is.  It will also check "
                                  + "\nto see if it's a leap year and adjust  "
                                  + "\nthe day of the year accordingly");
              System.out.println("************************************************************");
              System.out.println();
              //Create a Scanner object to read input.
              Scanner keyboard = new Scanner(System.in);
              //Input and print number.
              System.out.print("Input month: ");
              //Assign input
              month = keyboard.nextInt();
              //Input and print number.
              System.out.print("Input day: ");
              //Assign input
              day = keyboard.nextInt();
              //Input and print number.
              System.out.print("Input year: ");
              //Assign input
              year = keyboard.nextInt();
              //If leapyear, Feb has 29 days
              if(isLeap(year)==1)
                        Feb =29;
              //Determine day of year
              switch (month)
                         case 1:  doy=day; break;
                         case 2:  doy=Jan+day; break;
                      case 3:  doy=Jan+Feb+day; break;
                      case 4:  doy=Jan+Feb+Mar+day; break;
                      case 5:  doy=Jan+Feb+Mar+Apr+day; break;
                      case 6:  doy=Jan+Feb+Mar+Apr+May+day; break;
                      case 7:  doy=Jan+Feb+Mar+Apr+May+Jun+day; break;
                      case 8:  doy=Jan+Feb+Mar+Apr+May+Jun+Jul+day; break;
                      case 9:  doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+day; break;
                      case 10: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+day; break;
                      case 11: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+Oct+day; break;
                      case 12: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+Oct+Nov+day; break;  //hey! that looks pretty!
                      default: System.out.println("Invalid month.");break;
              //Print day of year
              System.out.println("Day of year: " +doy);
              }//endmain
              //beginmethod
              public static int isLeap(int y)
                   //Assuming Y2K compliancy is not an issue, all dates will be based in the year 2000+
                   y += 2000;
                   //Check if year is a leap year
                   if(y%4==0&&y%100!=0)
                        return 1;      //yes
                   else if(y%100==0&&y%400==0)
                        return 1;     //yes
                   else
                        return 0;     //no
              }//endmethod
    }

  • How can I change , in my Calander month/day/year to day/month/year

    My Calendar shows the date in the form of the U.S. in Mozilla Firefox and the repeat in Windows Live Mail shows it the way I need it i.e. day/month/year. How can I change this ?

    Please change dates in Calender to read day/month/year

  • I need FM calc. days/months/years between 2 dates but computes the work day

    I need FM calc. days/months/years between 2 dates but computes the work day.
    someone knows ?

    Hi,
    The FM is 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    Check the following example:
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Regards,
    Bhaskar

  • How to disable design time data binding?

    I am using Studio Creator IDE for the presentation layer and bringing the project into eclipse and from there moving on to creating daos,adding business objects etc.
    However, when re-importing my files from eclipse to the Studio Creator to make layout changes, on the design view, i keep getting all these SQL exceptions.
    Here's my current fix:
    For eg, if on a page i had a Data Table component, i comment out my dao methods that populate the cachedrowset for the table data provider and i add for eg:
    personRowSet.setDataSourceName("java:comp/env/jdbc/Travel");
    personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
    personRowSet.setTableName("PERSON");
    and only then, i am able to see my table component in the design view.
    Is there an option somewhere to tell the IDE not to check data bindings at design time???
    That would be very very helpful.
    Thanks!

    Hi,
    There is no option, ASAIK, to turn off the data bindings at design time. As you have mentioned the option that comes to my mind is to comment out the code for data binding till the design work is over.
    Cheers
    Girish

  • In Pages, how to insert a PRINT-DATE field into a doc.?

    Want to insert a field that will show the date of the doc's printing. 
    In MS Word, this is known as 'insert print date'.
    How to do so in Pages?  Thanks.

    You can define placeholder text in Pages v5.5.2 in any of the six header/footer sections. Think of it as a a field code that when you click on it the text you enter replaces the placeholder text using the same style. By example, I placed a combination of text and placeholder text in the lower left footer segment.
    The text and the brackets were selected, and then Format ▸ Advanced ▸ Define as Placeholder Text. Also, because it is in the footer, it is replicated throughout the document. Although you could Insert > Date/Time into this placeholder text, automation may be preferred. I have chosen to use the same date/time style as MS Word uses in its print date field code. You can only change placeholder text programmatically with Pages and AppleScript on Yosemite. Once I run the AppleScript, all placeholder tags are replaced as shown in this image:
    You could make this an Automator Service (e.g. run AppleScript action with no input, and output replacement is checked). One could assign a keyboard shortcut to this service too. One click printed date stamp and document sent to default printer.
    The AppleScript (Yosemite only).
    property tagStr : "[print-date]"
    --- used for testing ---
    -- set f to POSIX path of ((path to desktop) as text) & "arg.pages"
    -- set hf to POSIX file f as alias
    set printDate to "" as text
    set theTags to {}
    tell application "Pages"
          activate
          -- open hf
          tell front document
               set theTags to the tag of every placeholder text whose tag is equal to tagStr
               -- Word print-date field code uses this 12-hour date/time format as mm/dd/YY 00:00 AM/PM
               set printDate to do shell script ("/bin/date +'%D %l:%M %p'") as text
               repeat with i from 1 to count of theseTags
                     set thisTag to item i of theseTags
                     set (every placeholder text whose tag is thisTag) to printDate
               end repeat
               -- use your own System Preferences printer name string
               tell application "Samsung ML-2950 Series (Sammy)"
               activate
               -- no print dialog
                    print front document without «class pdlg»
                    quit
               end tell
          end tell
          -- close front document saving no
    end tell

  • Blog Archive Webpart Does Not List Posts When Publish Date is About early months,years in sharepoint 2013

    I create blog posts . Their publish date are different from now and their publish date are the early months. For example i create 30 blog bosts in 15.08.2014. But 10 blog posts' publish date is 15.04.2013,20 blog posts' publish date is 15.03.2012. I can
    not see them in the blog archive part. There must be April 2013 and March 2012 in the archive part,but i can not see them.
    How can i see them in the blog archive webpart?
    When i create a blog post, what is the main issue about the date? What is the main issue about date about grouping them.
    How can i show the blog posts according to the publish date not create date? İs it possible?
    Can you help me please?

    It seems you created another thread for same issue. Let's wait for the response from original thread, instead of creating a new one.
    http://social.msdn.microsoft.com/Forums/en-US/2a3f7d99-c74b-4554-94bf-e597a88b5425/blog-archive-webpart-does-not-list-posts-when-publish-date-is-about-early-monthsyears-in-sharepoint?forum=sharepointcustomization
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • How to apply pagination to data bind to asp:Repeater control using Camel Query.

    Hi All,
    I am having a <asp:Repeater> control to which i bind the data from share point list. 
    I want to apply pagination to that data which is bind to Repeater. I am using CAMEL query to get data from list. 
    How can i apply the pagination to this data fetch by camel which is bined to Repeater control.
    Thanks
    amol

    Hi,
    From your description, you might want to use CAML to query the needed items from a SharePoint list, then use a Repeater control to bind to these data with paging allowed.
    If so, here is a solution like this: Use
    CAML to query a collection of items and save them into a
    DataTable object. Then use the PagedDataSource object to achieve the paging for us and associate it to a
    Repeater control.
    Here are two links will provide more details:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7af4c865-a44a-4ccb-864d-9d834f8b2b87/bind-sharepoint-list-to-asp-repeater?forum=sharepointdevelopment
    http://sharepointdotnetfalls.blogspot.in/2013/07/repeater-control-with-paging-in-share.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • How do i import excel data base into pdf form drop down field

    Hi,
    I have a table of about 2500 rows and three columns that i would like to import into a drop down window on a PDF form to be self populated when item selected rather than entering the data. How can this be done?
    Thanks!
    Richard

    Hi,
    I did not know only two entries for each option item is it. I have manually entered data in the drop down an list boxes. With 2500 lines of data I was hoping there was an easier way other than manually entering the data.
    I have no knowledge of Java Scripting.....
    I was just wondering if there was a way from an Excel spreadsheet to import that data into a PDF form to be selectable to populate PDF fields in a form. It doesn't sound like it.
    Thanks......

  • How can i convert this data(00000000) into date format(yyyy-MM-dd)

    Hi,
    i am using this method to convert date format from string.
    public static string FormatDate(string inputDate, string inputFormat)
                System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
                string datepresent = DateTime.Now.Date.ToString("yyyy-MM-dd");
                return datepresent;
    its working properly,
    but when input data is like 00000000 i am getting error this is not valid.
    how can i convert this into date format any help..!

    Have you tried the above code:
    I can see it is working with both Date and DateTime destination nodes.
    Map:
    Functoid Parameters:
    Functoid Script:
    public static string FormatDate(string inputDate, string inputFormat)
    string datepresent;
    if (inputDate == "00000000")
    datepresent = "0000-00-00";
    else
    System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
    datepresent = date.ToString("yyyy-MM-dd");
    return datepresent;
    Input:
    <ns0:InputDateString xmlns:ns0="http://DateFormat.SourceSchema">
    <DateString>00000000</DateString>
    </ns0:InputDateString>
    Output:
    <ns0:OutputDate xmlns:ns0="http://DateFormat.DestinationSchema">
    <Date>0000-00-00</Date>
    </ns0:OutputDate>
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful.

  • How to bring a custom data element into another ods object

    I have an ods object which has a custom data element called customer purchase order number. I have another ods object which needs that custom data element. Both these ods objects are part of a multiprovider. How do I make the customer purchase order number available in the 2nd ods object? We are in SAP BW 3.5
    Thanks
    Ram

    Hi Ramgopal,
    as suggested by experts, create or use the custom infoobject.
    go to change mode of ODS (2nd ODS) add custom infoobject into data or key fields (similar to 1st ODS), then update rules od 2nd ODS will be deactivated. go to change mode of update rules and map with the infoobjects which feeds dat to custom infoobject (similar to 1st ODS)
    if routine is used to populate data copy and paste same routine and check routine and activate.
    Hope this helps.
    Regards,
    Daya Sagar

  • How do I parse map data?

    The data i want to parse looks something like this:
    sdf,dfffffs,safsf,asasrw,re6546eg,dfgert;
    gfgr,trt546,rgert,egrg,erg,ergretgreg,erg;
    basically its items seperate with a , and they are ended with a ;
    i want to make a 2d array out of that.
    my pseudocode:
    new string array [amountoflines] [amountofitemsinfirstline]
    for i=0 to amountoflines do (i++)
    while j>0 do
      while k>0 do
       array[i][j] = array[i][j]+characterat(k);
       if( "," ) k=-1;
       if( ";" ) j = -1;
    }would it work? what kind of methods do you suggest i use?

    Did i get iit?
    // inputstr = the map data
    String inputstr= new String("Sad,asf,sdf,dst;ret,ert,yyt,ryt;ry,tr,yt,ry;");
    // Creates an array and assigns it like this:
    // Line 1 : Sad,asf,sdf,dst;  (does it also assign the ";" ?)
    // Line 2 : ret,ert,yyt,ryt;
    // Line 3 : ry,tr,yt,ry;
    String[] tmpstr=inputstr.split(";");
    // Defines the "Map" Array
    ArrayList _2DArray=new ArrayList();
    // Goes through Line 1-3 (mentioned above)
    // For each line it:
    // Splits the items along the "," and stores them in a 1Dimensilnall String Array
    // Ads/Insterts that array into the correct spot for the 2D array
    for(int i=0;i<tmpstr.length;i++)_2DArray.add(i,tmpstr.split(","));Does When it splits test,test1 with "," does it also return the , ?

  • How can I parse this date format?

    Hey,
    i am trying to write an interface between two applications. One application gives me the following date:
         Wed Jul 16 12:18:20 CEST 2003
    but I need it to look like this:
         16.07.03 12.18:20
    I tryed to use Date and DateFormat to parse and change it but the Date was unparseable.
    I hope somebody can point me to the right direction or show me how I can do the formating.
    Thanx a lot!
    Martin

    If this isn't a well-known date format, I can't see any solution but to write small function yourself which doe the job.
    you can start with :
    String source = "Wed Jul 16 12:18:20 CEST 2003";
    String[] elements = source.split();//splits source around spaces
    then you write functions that map day of week with numbers
    "Mon" --> 1
    "Tue" --> 2
    etc...
    it won't take you days to write this.
    Sometimes it's faster to write the stuff yourself than spending days looking for something pre-defined that may or may not exist.

Maybe you are looking for