Setting the system time with only Java.

Am trying trying to write a 100% pure java Alarm Clark. One feature I wish to have is to syncronize with the atomic clock.
Is this possible in Java. All I have been able to find is system dependent ways to do it through exec.
Thank you,
Jacob

What do you mean "atomic clock"? Do you wish to synchronize your alarm clock with GMT? If so, you can directly access the National Institute of Standards and Technology's atomic clock on-line...see the site :
http://www.boulder.nist.gov/timefreq/service/its.htm
You could then get the local time from the computer, thus appropriately adjusting your clock. Synchronizing your system clock to the atomic clock is system-dependent, as mentioned by the other respondent.

Similar Messages

  • How do I set the system time?

    Hello
    The system time can be read using System.currentTimeMillis(), but, how can I set it?
    Thanks

    several approaches:
    you could use the OS function to set and call it via Runtime.exec().
    For WIndows e.g.: "time 08:15:00" to set the system time.
    another solution: http://www.rgagnon.com/javadetails/java-0285.html

  • How to set the system time in the program

    Hi All,
    How do we update the system time inside java programme.

    AFAIK there is no easy (pure java) way: either you exec something (depending on your paltform) or use native code. Appropriate privileges will be necessary.

  • Can I use Lightroom on my mac and my pc at the same time with only one subscription?

    Hello everyone,
    for five months now I have a Creative Cloud subscription for Lightroom and Photoshop. Till now I was just using it on my PC. Now I've bought me a MAC and would like to install Lightroom on the MAC either. Do I need a second subscription for MAC or can I use my subscription on the MAC and PC simultaneously?
    thx for feedback

    If you are asking if you can be running the subscription software on the two machines at the same time, the answer to that is no.  Per your license you can only be using one of the installations at a given time.
    If you are asking if you can have the software installed and capable of being used on both machines then the answer is yes... you just cannot have both machines in use  running the subscription software at the same time.

  • Setting the system property in java application

    Hi,
    I want to make a connection to https://URL through my java application class
    which will be deployed in the weblogic server. Could any one help by
    telling how could I set the system properties in my java application. If I
    pass the value in the java class do I have to change any value in the
    weblogic.properties file.
    Thanks in advance and looking forward to hear your valuable suggestion.
    Sirisha

    System.getProperty(..)
    System.setProperty(..) is this what you are asking for?
    This gets and sets the system (your machine) environment properties
    Filip
    In article <396d0a93$[email protected]>, [email protected] says...
    >
    Hi,
    I want to make a connection to https://URL through my java application class
    which will be deployed in the weblogic server. Could any one help by
    telling how could I set the system properties in my java application. If I
    pass the value in the java class do I have to change any value in the
    weblogic.properties file.
    Thanks in advance and looking forward to hear your valuable suggestion.
    Sirisha
    Filip Hanik
    Software Architect
    XMarkstheSpot.com
    [email protected]

  • How to check the current time with a Stored  time in string format

    Hi All
    I would like to compare the system time with an existing time values which is allready there in String format..
    i mean i would like to check if the SysTime is inbetween 6:30 and 14:00
    I accomplished this in Oracle ..
    Select 'Y' from dual where to_date(to_char(sysdate,'HH24:MI '),'HH24:MI') between to_date('06:30','HH24:MI') and to_date('14:00','HH24:MI')
    But instead of checking the DB each and every time , the perfomance would be better if we can do this in our java code..
    Could some one provide me with a code to accomplish the above scenario..
    Thanks in advance..,.,

    import java.util.Calendar;
    Calendar rightNow = Calendar.getInstance();  // gets the current date and time to millisec
    Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
    Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
    if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
    // do something
    }Try this.

  • Changing the System Time

    I am using a SunBlade 1000 and C++ with Workshop 6.1. I would like to change the system time via a program written in C++ without having to log in as super-user. Is that possible ? I was thinking about using the settimeofday function, but according to the man information I only can use it as super-user.

    You are correct. Only root can set the system time. You should
    probably consult your local system admin or discuss the implications
    of trying to do this in the Solaris forum. There are possible security
    holes opened up by trying to do root's job programatically.
    In general, a C program can use the system() call to run a command
    that would be typed in at the shell. A program can also have the
    Set UID bit and run as root, but you should be well aware of the
    risks associated with that before you try to use it.

  • I want to get and set windows system time through lab view

    Hi
    I want to get and set windows system time with the help of lab view 8.5.
    please help me out.
    ekanth

    You can use the call library function node. Once you drop it on your block diagram double click it and you will be able to select the dllyou want to use. Choose kernel32.dll and you will see methods listed called getsystemtime and setsystemtime. Use those
    CLA, LabVIEW Versions 2010-2013

  • How to set the system clock in win2000? in linux? (RH)

    hi There,
    I need to set the system time on a pure java application.
    what is the proper way to do so? (I can't find any system property which corresponds to the system clock).
    if it's platform dependent , then I need to do so on win2000 and on linux RH.
    thanks

    I don't know about Windows but on RedHat, I would use the date command. Check the man pages for date and look at the -s or --set options.  Do a Runtime.exec to execute that.
    Of course, doing the in Java is not the best option. If you are trying to synchronized clocks on Windows and Linux systems, I would use some freely available Network Time Protocol programs. RedHat has a free NTP daemon available as an RPM in the standard distribution. For Windows, theres a free program called "Net Time" that runs as a service. Both can act as clients and servers.

  • Is there any danger in setting the system date/time to a prior date?

    We are dealing with some software digital certificate expiration issues.  Until the developer gets them fixed, the only way we can use the software is to set the date/time preferences to a date before the certificate expired.  Some users are concerned that this will spell catastrophe for their systems because Unix/Linux based things don't like haivng their dates messed with.  I maintain that the only things that would be affected are the date/time stamp on files they save while the settings are changed, possibly any iCal events created during the change (which can be overwritten by the user), and that if they use Time Machine the backups might not be dated correctly (and for that reason I've suggested they shut Time Machine off while their date is changed).  I just don't believe it will lead to massive system failure.  Who is correct?

    Yes you will have issus with DHCP leases/Internet and your router if your time and date isn't current.
    Offline you can do what you want. Better to get a temporary workaround from the developer to hold you over.

  • When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When two or more devices conflict it typically means that the DHCP service is either misconfigured or is not running at all. DHCP provides IP addresses to local network clients.
    Is your AirPort Express base station the only router in your current network configuration? That is, is it connected directly to an Internet modem and not to another router upstream of it?

  • I live in Italy and I am trying to buy an App, for the first time with my iphone4...in the past only downloaded free apps free apps; I have a US Visa card and it is not accepted by italian Itunes...what can I do to do my purchases?

    I live in Italy and I am trying to buy an App, for the first time with my iphone4...in the past only downloaded free apps free apps; I have a US Visa card and it is not accepted by italian Itunes...what can I do to do my purchases?

    On the apple website that is correct i beleive.... but i have an italian american express and am able to purchase stuff here in the US.
    I mean, i dont think it really matters

  • Can you use 2 sets of bluetooth headphones at the same time with the Ipad 4?

    Hi, I was wondering if anyone could tell me if I can use 2 sets of bluetooth headphones at the same time with the Ipad?
    It is so my children can watch a film or listen to music together.
    Thanks

    No

  • When I try to set the automatic time zone on my iPad in Settings all I get is the "waiting" wheel constantly turning.    The only way to set the time is in the manual mode.  Does anyone else have this problem?  Thanks!

    When I try to set the automatic time zone on my iPad wi-fi mini in Settings all I get is the "waiting" wheel constantly turning. 
    The only way to set the time is in the manual mode.
    How to solve this problem?
    Thanks!

    You must be connected to a good wifi network for it to reach an outside time server.

  • To compare given time with the system time

    i need to compare the given time with system time.i dont know how to compare with system time
    in my application i need to end the time when both time is equal i need to give permission to access my page
    thank u
    plz help me

    Date d =new Date();
    System.out.println(d);
    Date d1 =new Date("04/28/2006 16:37");
    System.out.println(" "+d.getTime()+"  "+d1.getTime());you can use like this. d1 contains the user date
    as u mentioned
    startTime = new Date( "04/28/2006 12:37");
    EndTime = new Date( "04/28/2006 18:37");
    if curTime = new Date();
    then you can compare like
    if(curTime.after(startTime) && curTime.before(EndTime)
    hope it will work

Maybe you are looking for

  • Inline list of values from APEX views/tables

    Hi All, What table/view should I refer to get all the inline list of values from form on a table or view not reports (tabular forms). I want data similar to the one obtained for tabular form reports using APEX_APPLICATION_PAGE_RPT_COLSAppreciate your

  • Can i buy an Iphone 5 from the USA if I live in Ireland?

    Hi I was just wondering am i able to buy an iphone 5 or iphone 4s unlocked from apple online or in store in America and will it still work if it is brought to Ireland? thanks x

  • How to display no data found for two different elements

    i wanted to display report either by dept wise or supplier wise so when I dont have deptno related data It should say no data found for that I'm using if condition same for supplier too instead of giving twice can I give it in the same if condition i

  • ResultSet won't update

    I'm busy trying to write a database app (first time using java.sql). I use the jdbc:odbc bridge to connect to an Access 97 database (not my choice). Problem is I have written few thousand lines and have dialogs that can DISPLAY the data, but when I t

  • Call procedure dynamically

    can anyone tell me if it is possible to call aprocedure when the procedure name is held in a form item. ie i have a form item :blocka.proc_name that has a list of all the procedures that the user can run. if the user selects 'proc1' into this item fr