Getting current date without using client's clock

Is there a way to get the current date without using client's clock?
The java application we developed has many windows on which the Current Date is an important display field. As it's used 24x7, we need to make sure the date is current.
Right now, we make a CORBA service call to get the date from the server everytime the user Resets any of these windows. This is causing a peformance issue due to the slow service call.
Is it possible to get the Date once from the server and then start a timer to derive the date thereafter. Will a change in the client's clock affect this logic ? Can we implement this without using client's system time.
Or is there another better way ?
Thanks for your help.

If I can summarize your current requirements:
1. You need to know the time.
2. You don't trust the client's clock so you want to get the time from another computer.
3. You want this access to be "not too slow".
I find requirement number 2 to be peculiar, I've never seen an application that doesn't accept the time on the client system as valid. However, there it is. Maybe it's a system for checking employees in and out, and the smarter ones have been faking out the system by changing the clock. If your CORBA connection is too slow, and NTP is too slow (it takes the little program I got from USNO about 3 seconds to synchronize my clock), why not write your own time server? A simple web server that returns only the time to any request would work. If that's not fast enough then I'd suggest you're out of luck.

Similar Messages

  • Getting Current Date and using it in SQL

    How do you get a current time and store it in a variable..
    I am trying to make an a SQL query using it to search for all previous days appart from today.
    ex:
    currentDate = // store current  date as a ShortDate into a variable
    query = "SELECT * FROM Table WHERE < DATES "+currentDate+" ORDER BY Id"";

    Regarding prepared statement .
    I am trying to insert the date into a variablelike
    below.
    String date = newjava.sql.Date(myDate.getTime());
    I want allow me .... there really has to be a wayto
    get a current System Date within java.That is because you have a lot of errors in that
    line..
    java.sql.Date now = new
    java.sql.Date(System.currentTimeMillis());If you want it as a sql date object (date object in
    sql doesn't have a time field, you need to use
    Timestamp if you want date and time)
    /Kajjava.sql.Date now = new java.sql.Date(new java.util.Date().getTime());

  • Problem with getting current date and time using oracle.jbo.domain.Date

    I`d like to get current date and time using oracle.jbo.domain.Date method getCurrentDate(), but it always return current date and 12:00:00. I also need to get the current time.

    I think you should use java.sql.Timestamp domain.
    (And set database type to TIME or DATETIME.)
    Jan

  • How does BR get current date, user, and associate member with Attribute Dim

    I need use Business rules or Calc script to implement following functions:
    1. Get current date and the name of user who is running the BR and save the information to cube.
    I don't find any functions to get current date and users.
    Also, since text and date is store in relational database and essbase cube only stores the index, it looks that the value can't be changed or stored by using "==" directly, is there any function to change value of members with Text or Date types in BR/Calc script?
    2. End users select attribute value (via smart list) of products or projects(Sparse dimensions) in data form, run BR to update the association of these members with attribute dimension.
    I don't find any functions to change the attribute association in BR/Calc, is there any CDF (Custom Defined Function) that can do it?
    Thanks!

    Hi,
    For the date functionality, check out the post below.
    Re: Days behaviour between two dates
    As for the username, there is a little tricky way that requires an unused or a new dimension along with a smart list of user names. It's also possible to capture the user name from the cookies and pass it on to the form. The latter is possible through validatedata.js however requires hefty coding here and there.
    As for the attributes, it's not possible to update metadata through business rule. So no luck in there.
    Cheers,
    Alp

  • Different discount date from that of due date without using payment terms

    Hi,
    We would like have separate discount due date from due date without using payment terms for each invoice.
    We wants to modify ERDK-FAEDS but unable to find suitable event/exit for the same.
    So can anyone suggest any event where this can possibly be achived.
    Regards,
    Paresh

    Hi,
    We are using continuous days for working out due date from document date.
    But for discount due date business sought to provide only working days (say 7 days) from document date.
    So as to satisfy this requirement, I had adopted event R436 where system intially takes values provided but somehow it gets cleared in below lines. So I am unable to find a workaround to resolve this issue.
    PERFORM get_user_exit_function USING 'R436'.
      LOOP AT t_fbstab WHERE funcc <> 'ISU_SAMPLE_R436'.
        tmp_erdk = p_iiu-print_doc-erdk.
        tmp_erdz[] = p_iiu-print_doc-t_erdz[].
        CALL FUNCTION t_fbstab-funcc
          EXPORTING
            x_invoice_param    = p_param
            x_invoice_unit     = p_iiu
          TABLES
            xy_printdoc_lines  = tmp_erdz
            y_new_bill_lines   = tmp_new_bill_lines
          CHANGING
            xy_printdoc_header = tmp_erdk
          EXCEPTIONS
            error_message      = 1.
    Regards,
    Paresh

  • How to get current date for posting date

    hi,
    how to get current date for posting date ? any sample code ?
    Thanks

    Hi......
    Use
    Select getdate()
    for current date.......
    Regards,
    Rahul

  • Get current directory(without user.dir)!!!!

    Dudes,
    need help badly... i need to get the current directory of the jar file where it gets launched from. Since the launching takes place from an html file, the system property "user.dir" does not get set to the current directory. Both the html as well as the jar file is in the same location.
    so in short, i need to get the current dir without using the user.dir that i can later set it explicitly thru my program(to the current dir)

    "Search the CLASSPATH for the first occurence of your jar file... but FFS only do it once, and save the result"
    Cud ya elaborate that statement.
    Also, the reason i wanna know is this : my jar file references all the images that it uses, thru a relative path(./a/b/c.....). So wen i simply double click the jar file, the relative path("./") gets replaced with the current workin directory(from user.dir) and fetching of images works perfectly. But if it is launched via html, the user.dir does not get set to the current working dirctory and as a result the jar file looks for its images in the default location which is the desktop. so it doesnt work
    Now that the context is clear, is there a way out???? or is there any way in which i can set the user.dir from the html itself(maybe by using javascript or somethin??)

  • To get current data block name

    Hi;
    I have 2 data blocks on my form and I want to get current data block name on my form. How can I do this???
    Thank you

    Like Rosario said, use the :SYSTEM.CURSOR_BLOCK.
    you can also use :SYSTEM.TRIGGER_BLOCK in triggers to find which block was responsible of the firing event of a trigger.
    Do not use :SYSTEM.CURRENT_% variables in Forms 9i and above, those are only there for compatibility reasons.
    You can also check the online help for more details on :SYSTEM.% system variables.
    Tony

  • Get current date style

    Hi
    How I can get current date adn time style?
    Thank you.

    Well, what do you need it for? If you just want to use the default locale when parsing/formatting a date, you just use DateFormat or SimpleDateFormat. You don't need to worry about the pattern.
    If you want to check what the pattern is with the default locale, you can try this:
    SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getInstance();
    System.out.println(sdf.toPattern());There is also a distinction between short, medium and long format, and you can get the time or date pattern only if you want. Check the API.

  • Get  current date and time

    hello.
    How can I get current date and time in JAVA?
    Thanks.

    Sorry, I mean:
    how can I get the value of DATE, MONTH, and YEAR of the
    current date?
         Date date = new Date();
         System.out.println(date);

  • How to display table data without  using ALV  and table element.

    Hi,
            Its possible to display table data without using ALV  and table element.
           Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
           (every time i am fetching single row data ),
           But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
           settings and header data etc..things.
          Give solution to  display data part..
    Regards,
    Rakhi.

    Hi,
    Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
    In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
      DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
        LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
    * Standard Filter Function setting to FALSE
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
    * Standard Filter Function setting to FALSE Ends
    Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
    Hope this answers your query.
    Thanks.
    Kumar Saurav.

  • My friend borrowed my old iPhone 4. I wanted to erase all the data but I dont have a password and my friend doesnt know his password. How can I erase the data without using a password?

    My friend borrowed my iPhone. I want to sell the iPhone, but first I have to erase all the data that belong too my friend. I don't know his password and he doesn't know either. Is it possible to erase the data without using a password?
    thanks!

    You need the password if it is iCloud locked you won't be able to activate the phone for use.
    As long as he remembers his email,  you can reset the password
    If you forgot your Apple ID password
    or Forgot Apple ID
    https://iforgot.apple.com/appleid
    If it is a lock screen password, you can do a restore.
    Hold down power and home for 10 seconds and release power but keep holding down home. iTunes will say your phone is in recovery mode so you can restore it.

  • Transfer data without using IR

    Hi,
    It is possible to transfer the data without using IR
    to ID..and any other cases
    thanks
    guna

    Hi,
    yes it is:
    How to send any data (even binary) through XI, without using the Integration Repository
    Regards
    Patrick
    Edited by: Patrick Koehnen on Jul 22, 2008 5:07 PM

  • How to access data without using authorization variable in report?

    Hello All,
    I am using two varibles in report, without using exit varible in report how to get the data based values enter in the ohter variable.
    How to find the roles and display the data " with out using the concept called varible used in report"

    Sorry..for late response.
    Answers to your questions:-
    Previous day to current date.
    I tried to follow steps given in the following link but failed as we have Teradata as data source and I dont know how to write a syntax for teradata similar to what is explained by Dave.
    http://www.dagira.com/2007/08/22/dynamic-dates-part-i-yesterday-and-today/
    Regards

  • How to Get Current Date from MS Access in a Select Statement

    From a java method, I want to use JDBC to get the current date from MS Access. In Oracle I would do "select sysdate from dual", but I can't figure out how to do it in MS Access. Here are some of my attempts. I have a table in my Access db called PARM.
    //        String sql = "SELECT '0', NOW() FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT DATE() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW()"; 
    //StringIndexOutOfBoundsException: String index out of range: -1
    //        String sql = "select { fn now() } from parm";
            String sql = "SELECT Date()";
    //java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            ResultSet rs = stmt.executeQuery(sql);
            if (rs.next()) {
                return rs.getString(1);
            } else {
                   return null;
              }

    Why are you getting it as a String? You should be getting it as a timestamp.
    Although getString works for me too. There is something else wrong that you haven't shown.
    Here is some shoddy, but simple, test code that demonstrates it working.
    import java.sql.*;
    public class Test{
      public static void main(String args[])throws Exception{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection c = DriverManager.getConnection("jdbc:odbc:stats");
        Statement s = c.createStatement();
        ResultSet rs = s.executeQuery("SELECT NOW()");
        while(rs.next()){
          System.out.println(rs.getTimestamp(1));     
        rs.close();
        s.close();
        c.close();
    }

Maybe you are looking for

  • Multiprovider - BI planning - to which cube will be data save

    Hello, I solve the problem with multiprovider in BI planning. We have about 10 infocube connect in one Multiprovider. How can I ensure that the right data will be save to the right Infocube? I try it with Characteristic relationship but I have proble

  • IDVD plays on DVD player but doesn't open on PC

    I created a DVD slide show using iDVD and included the image files. After burning the DVD, it plays on DVD players and my Mac, but will not play or read on a PC. Is there something I am missing? How do I burn the iDVD slide show that includes picture

  • I'm in trouble with a cin

    HI, i'm trying to create an .lsb file for my cin using visual c++. i have followed all the instruction step by step....but it doesn't came out.what can i do? thanks a lot

  • Elements 9 - Actions

    I download an action but have problems to install this actions There are 3 files : .atn, .png and .jsx .atn + .png are installed in following folder : ProgramData\Adobe\Photoshop Elements\9.0\Photo Creations\Photo Effects The only thing that I do not

  • Offloading 3 SD Cards at once to FW800 Drive

    I have a late 2011 MBP 13" that I will be off-loading 3 SD cards at a time to a FW800 drive enclosure. 2 cards will be connected over the USB 2.0 ports and one card will be in the card slot. My question is this - where will the bottleneck in bandwidt