How to compare date and time together

Hi,
How to compare Date and Time together?
For example in a database table there are two fields rundate and runtime.  I want to compare these two with perticular date and time in the program.  Like, I want to pull all the records where the records's date and time are less than a perticular date and time in the program.
Hope the question is clear...
Thanks.
Kavita

Hi Kavita
There is no as such Date and Time Comparision FM in Standard SAP  But You can define your own like this
<b>FUNCTION ZAV4_COMPAREDATETIME.
""Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(DATE1) TYPE  DATS
*"     REFERENCE(TIME1) TYPE  TIMS
*"     REFERENCE(DATE2) TYPE  DATS
*"     REFERENCE(TIME2) TYPE  TIMS
*"  EXPORTING
*"     VALUE(TWOISMORETOPICAL) TYPE  C
  twoismoretopical = ''.
  if date2 > date1.
    twoismoretopical = 'X'.
  else.
     if date2 = date1 and time2 > time1.
       twoismoretopical = 'X'.
     endif.
  endif.
ENDFUNCTION.</b>
Regards
Mithlesh

Similar Messages

  • How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    BKBK,
    Thank you for your response. That does adequately cover the
    client-originated sessions, but still leaves the ability I am
    looking for unavailable.
    It did serve to definitively answer my most pressing
    question, however, with this statement:
    Note: ColdFusion cannot create a session if an initiator
    application uses a SendGatewayMessage method to start an
    interaction with a client, such as an SMS user. In this case, the
    sending code must keep track (for example, in a database) of the
    messages it sends and their destinations. When a response event
    arrives, it can look up the origniatorID to determine whether it
    was in response to an outgoing message.
    I will play around with the Application scope to see if there
    might be a workable solution there.
    RLS

  • How to display date and time on jsf page

    Hi,
    how to display date and time on jsf page
    we are using 11.2.0.0 jdeveloper on windows.
    thanks
    Edited by: user12187801 on 26-Jul-2012 01:42

    Your question is certainly lacking some information.
    If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
    If you meant something else, then it's back to you to explain.

  • How to set date and time on apple tv

    how to set date and time on apple tv

    Assuming this is not the first time you have used your Apple TV
        1.    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
        2.    Also try restarting the router.
        3.    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If this is a new Apple TV, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

  • How to find date and time on photo taken by iphone?, How to find date and time on photo taken by iphone?

    How to find date and time on iphone's photo taken?

    in iPhoto no matter the source of the photo you see the information about th ephoto by selecting the photo and showing info (the get info button may be in a different location depending on the version of iPhoto you have)
    If you are not aking an iPhoto question but are asking an iPhone question instead then repost in the iPhone forum - iPhoto has no association with the iPhone
    LN

  • Need help in using SQL in a jsp file to compare date and time

    hi every one,
    Actually I am doing a project using JSP. I need to compare a date field in the database (MS Acess) to the current system date and time. I have to do this in a select statement.
    I have alredy defined a variable of type Date in the JSP file and I am comparing this variable to the date in the database through a select statemant.
    Here is what I am doing
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
              java.util.Date today = new java.util.Date();
              String myDate=sdf.format(today);
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= "+myDate+" ;";
    EDate is the feild in the database and it's format is (5/12/2008 5:29:47 PM) it is of type Date/Time in MS Acess.
    when I execute the query it gives the following error
    SQL error:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'EDate <= 2008-10-16 08:10:07'.
    I hope any one can help me with that error and answer my question, I've tried too many things but nothing helps
    Thanks in advance :-)

    Hi,
    When the comparision is needed to be done with the current date , we don't need to send in Java
    Date then format it and compare with MS Acess Date.
    In MS Access we have Date() function which will give you the current date.
    So you can try rewriting your query as following :
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= Date() ;"; ---------------------
    Hope this helps.
    Thanks

  • How to change date and time format

    Hi experts,
    Can i know how to change the date and time format?
    I want the date format to be dd-mmm-yyyy  and time format to be hh:mm:ss
    These date and time is in my sapscript form.
    I make use of PERFORM function in sapscript.
    This is the code in my print program.
    FORM get_actlog_QA TABLES in_tab STRUCTURE itcsy
                           out_tab STRUCTURE itcsy.
       DATA: object TYPE string, "
            qaname LIKE JCDS-USNAM, "NAME for engineering process, QA Manager
            qadate LIKE JCDS-UDATE, "DATE changed in engineering process, QA Manager
            qatime LIKE JCDS-UTIME. "TIME changed in engineering process, QA Manager
    DATA: lt_jcds type standard table of jcds,
          wa_jcds like line of lt_jcds,
          new_date(10) type c.
      READ TABLE in_tab INDEX 1.
      MOVE in_tab-value TO object.
      select * into CORRESPONDING FIELDS OF TABLE lt_jcds
      from jcds WHERE objnr = object
        AND  ( stat = 'E0005' )
        AND inact = ''.
      Loop at lt_jcds into wa_jcds.
          qaname = wa_jcds-USNAM.
          qadate = wa_jcds-UDATE.
          qatime = wa_jcds-UTIME.
       READ TABLE out_tab INDEX 1.
       MOVE qaname TO out_tab-value.
       MODIFY out_tab INDEX sy-tabix.
       READ TABLE out_tab INDEX 2.
       MOVE qadate TO out_tab-value.
       MODIFY out_tab INDEX sy-tabix.
       READ TABLE out_tab INDEX 3.
       MOVE qatime TO out_tab-value.
       MODIFY out_tab INDEX sy-tabix.
      endloop.
      clear wa_jcds.
      ENDFORM. 
    This is my PERFORM in sapscript.
    /:           DEFINE &V_QANAME& = ''.
    /:           DEFINE &V_QADATE& = ''.
    /:           DEFINE &V_QATIME& = ''.
    /:           PERFORM GET_ACTLOG_QA IN PROGRAM ZFIR002
    /:           USING &VIQMEL-OBJNR&
    /:           CHANGING &V_QANAME&
    /:           CHANGING &V_QADATE&
    /:           CHANGING &V_QATIME&
    /:           ENDPERFORM.                     
    Sapscript
    Prepared by : &V_QANAME& ,, &V_QADATE& ,, &V_QATIME&
    The output now is
    Prepared by: Name   20080312  115536 
    I want to change the date format to 12-MAR-2008
    and the time format to 11:55:36 
    Can anyone please suggest on how to solve this?
    Thank you.

    Hi,
      Before assigning the  QADATE value you can write the logic to display  20080312   as  12-MAR-2008  taking the offset values .
    Like
    qadate = wa_jcds-UDATE.
    qatime = wa_jcds-UTIME.
      lw_year    = qadate(4).
      lw_month = qadate+4(2).
      lw_date    = qadate+6(2).
    case lw_month.
    when 1.
    when 2.
            concatenate lw_date  '-FEB-'  lw_year into qadate.
    when 3.
          concatenate lw_date '-MAR-' lw_year into qadate.
    endcase.
    READ TABLE out_tab INDEX 2.
    MOVE qadate TO out_tab-value.
    MODIFY out_tab INDEX sy-tabix.
    And you can also change the timeformat also  .
    then assign that value to qatime .Then
    READ TABLE out_tab INDEX 3.
    MOVE qatime TO out_tab-value.
    MODIFY out_tab INDEX sy-tabix.
    I think this helps you.
    Regards,
    Rajitha.

  • How to show Date and Time with TimeZone

    Dear All,
    I have to show Date and Time with TimeZone abbreviation,
    for example:
    1) 31 March 2011 2:30 in india standard time - it should show in screen 31 March 2011 2:30 IST.
    2) 31 March 2011 2:30 in Australia/New Zealand - Eastern time zone it should show in screen 31 March 2011 2:30 AEST.
    how can i show *Australia/New Zealand - Eastern time zone to AEST*,
    I tried with format DD MMM YYYY HH:MM zzz, and i looked time zone API too.
    Appreciate your help
    Thanks
    Daya

    Dayananda wrote:
    ok, than i have to use zzzz format, as z won't help in my case, so i have to use zzzz which display descriptive value like, Indian Standard Time i.e. ISTPer the javadocs there is a very specific reason why that is a problem especially if you intend to support many timezones in one application.
    "+For compatibility with JDK 1.1.x, some other three-letter time zone IDs (such as "PST", "CTT", "AST") are also supported. However, their use is deprecated because the same abbreviation is often used for multiple time zones (for example, "CST" could be U.S. "Central Standard Time" and "China Standard Time"), and the Java platform can then only recognize one of them+."
    Thus you have one single case where there can be many and moreover it can change (twice a year I believe.)
    There is a standard source for this information although when I tried it it appears to not work.
    If the app only needs to display one zone then provide a configuration value that allows a user to overload the display value.
    If the app needs to display many values then you MUST inform business users of the problem because there are duplicates and they, not you, need to decide specifically what happens in those cases.

  • How to provide date and time stamp to the extracted file.

    I 'm downloading data from DB to Flat file using GUI_DOWLOAD. whenever it is executed it is creating with a file name.
    if i rerun the program the file is overwriting with the same name.
    now based on the requirement how many times i executed, that many times file should be individually created and should be added with date and time stamp.
    like
    if when i executed  at the very first time it should saved with filename, date and time.
    say "Address.txt 04/05/2007 07:55:10"
    When i executed it for second time it doesn't overwrite the file.
    it should create a new file.
    like "Address.txt 04/05/2007 07:59:20".
    Please guide me the way if possible code.
    Thanks in advance.

    Hi Vamsi,
                   Use FM 'F4_PROGRAM' to take file from the user .
    In this case user will enter the file name. u can append date & time to that file path.
    Refer this code.
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SY-REPID
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_P_FILE.
    concatenate P_FILE '04/05/2007 07:59:20' into V_FILE.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_file
         filetype                        = 'ASC'
          write_field_separator           = 'X'
        TABLES
          data_tab                        = i_tab
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF sy-subrc = 0.
        MESSAGE i002.
      ENDIF.
    Reward points if helpful.
    Regards,
    Hemant.

  • Function module for comparing dates and times

    Hi,
    I have a date and time stamp in one filed for example as below:
    20070125183045
    (the first 8 are date in YYYYMMDD format, the next 6 is time in HHMMSS format). Now I want to compare this value to another such value in terms of date and time. First I want to compare dates and then times. Do you know any function module that can serve this purpose?
    Thanks very much!

    You can compare these using the function module DURATION_DETERMINE.  This fuction will give you the difference, and it can be in a view different units, such as the difference in days, months, etc.
    Funciton module takes in Start date and time and end date and time.
    Regards,
    RIch HEilman

  • How to find date and time on pics and video on iphone 4

    how do you find the date and time of photos and video on iphone 4?

    Your question is certainly lacking some information.
    If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
    If you meant something else, then it's back to you to explain.

  • How to know date and time information from Trace File defaultTrace.X.trc?

    Hi, all.
      i'm using EP 6.0 SP9 patch 1.
      As you know, default trace is written in the <SID>\JC00\j2ee\cluster\server0\log\defaultTrace.X.trc.
      By using the default trace formatter, it shows like the following sample messages.
    #1.5#0011110E7B2000590000000100000A100003EC71562E6EBC#1104396451585#com.sap.jms.server.ServerClientAdapter##com.sap.jms.server.ServerClientAdapter#Guest#18####716257115a3f11d9b73b0011110e7b20#SAPEngine_Application_Thread[impl:3]_23##0#0#Error#1#/Applications/JMS#Plain###JMS internal error at ServerClientAdapter! JMS Service is not started!#
      My questions are
      1. how do we retrieve the date and time information from the above message? It seems that this message has date and time info because LogViewer shows the date and time based on the above message.
      2. how do we change the above date format to easier one
    like "YYYY:MM:DD:hh:mm:ss"? i know that it can be configured from the Visual Admin --> Services --> Log Configurator but i don't know the exact place for the trace file.
      Thanks.

    Hi Sejoon,
    I use the standalone Logviewer to read the log files. Works great.
    "If you have an SAP Web Application Server Java 6.20 or below you may also get a standalone_logviewer.zip file at the SAP Service Marketplace at service.sap.com/download &#8594; SAP NetWeaver &#8594; Release ‘04. In this case JDK version 1.3 or higher must be installed on the system. The java version must be same on the server and the client.
    In the SAP Web AS Java 6.30 installation a folder named logviewer_standalone can be found under: <path Of J2EE installation>/<SysID>/JC<nr>/j2ee/admin/logviewer_standalone. Verify that the batch file logviewer.bat is installed in the directory logviewer-standalone.
    (source -> http://help.sap.com/saphelp_nw04/helpdata/en/e4/540c404a435509e10000000a1550b0/frameset.htm)
    Best wishes,
    Noel

  • How to use date and time

    hello,
    how can i use date and time in windows platform for export dumpfile.

    you can use this..
    C:\>echo backup_daily_%date:~4,2%_%date:~7,2%.log
    backup_daily_03_12.log
    may be you will have to adjust ~values to show proper values.
    Hope that will help you
    Anil Malkai

  • How to Change date and time on my printer

    I want to know how to change the date and time on my printer.

    annazmussaqib,
    OK, now enter the following command in the administrative user’s Terminal window:
    sudo date -n 122921502013
    When it asks you for a password, enter your administrative user’s password; it will not show the password as you type it.
    After you enter that command, enter this command again:
    date
    It should show a date and time that is close enough to the actual date and time that you should be able to go into the Date & Time pane of System Preferences without it hanging.

  • How to get Date and time of the server?

    Hi, How can we get the date and time of the server while submitting a form using JSP? i.e I need the date and time , when the user is submittig a registration.
    Uma

    Upon receiving your data in your servlet, you can do the following to get the date,
    Calendar calendar = Calendar.getInstance();
    int dd = calendar.get(Calendar.DAY_OF_MONTH);
    int mm = calendar.get(Calendar.MONTH) + 1;
    int yyyy = calendar.get(Calendar.YEAR);
    String dd_mm_yyyy = dd + "/" + mm + "/" + yyyy;
    To get the time, simply take a look at the Calendar API to get the corresponding field.

Maybe you are looking for

  • Object based navigation in portal works in firefox/chrome but not in explorer

    Hello, Im running a portal 7.3 with ECC6 EHP7 as backend. im attemting to trigger an object based navigation from the mss application. the object based navigation is triggered in firefox but in in explorer ive attempted to HTTPTrace , it seems that c

  • DB adapter throws error while inserting ORABPEL-11616

    Hi, I am using SOA suite 10.1.3.5. I have configured the BPEL DB adapter to insert into table AP_INVOICES_INTERFACE and i am getting the following error. I tried inserting record manually to the table and it is getting inserted. Any help in this rega

  • Can we change the name of reassign button in sharepoint 2010 approval workflow?

    can we change the name of reassign button in sharepoint 2010 approval workflow? Shazil Ali

  • How to call jsp page from OA page

    Hi all, I am new to OA Framework..I have a requirement where i have to navigate to a new jsp page.. on clicking a link in the OA page.The major trouble in this is that , that new jsp page should open in a new window.. not in the same window. Please g

  • Javascript to pause/play project

    So I created an HTML5 project with CP8 and have a button on top to pause play the movie connected to an advanced conditional action to pause and play. Here are the screen shots: This action works fine until a hyperlink or a button with external link