Set system time in both unix and NT

i need to write a software to be run on the 2 platforms to set the system time if anyone know how to go about doing it please guide me along and provide me some code.
thanks in advance

You cannot set the system time using pure Java, so I guess you'll have to use JNI or Runtime.exec().
If you use JNI, you'll have to set up a native method and the build a different DLL for each platform. From my point of view this is the cleanest way.
Using exec() requieres to detect the system your program is running on, and then call the appropiate external program or command.

Similar Messages

  • Synchronize system time and set system time zone in SAP

    Hi,
    How to Synchronize system time and set system time zone in any SAP system?

    Nabarun -
    Setting of the system time may be different depending on your enviroment and systems.  (Windows, AIX, etc)
    Windows enviroment you can use a time server or net time command, I believe its simialr with UNIX but I do not know that command.
    Setting the time zone in SAP is done through the IMG in client 000.  You can get there with transaction SPRO.
    Once in the IMG, navigate to:
    SAP Netweaver
    General settings
    Time Zones
    Maintain Time Zones (here you can define the time zone settings/rules)
    Then go to:
    SAP Netweaver
    General settings
    Time Zones
    Maintain System Settings
    There you can change the time zones for the system.
    Hope this helps.
    Regards,
    Zecher

  • Set system time to myrio programmatically synchrinized with GPS

    Hello,
    I have succesfully connected the PMOD GPS to my RIO and i extract the time and date string from the NMEA sentence in the following format:
    Time: HH:MMS
    Date: DD/MM/YY
    I would like to synchronize myrio system time to the GPS time. I have tried to use the nisyscfglvlib: Set Time.vi. For test purposes i try to set the time using a time stamp constant like the attached picture. However, when i run this code i get the following error. Where i can find this library and how do i add it to myrio? I
    LabVIEW:  Failed to load shared library nisyscfg.*:nisyscfg_lv_sysapiPropertySetString:C    . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
    LabVIEW:  Failed to load shared library nisyscfg.*:nisyscfg_lv_rmcfgPropertyGetItem:C    . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
    Is there another way to set the time of myrio programmatically?
    Thank you,
    Christos
    Attachments:
    set system time.JPG ‏14 KB

    Hi ckyamaha, 
    Below is an example on how to set a real time system's time using the System Configuration API.  
    https://decibel.ni.com/content/docs/DOC-20082
    It sounds like you may need to include the library on your myRIO when you configure it in NI-MAX.  If you haven't already installed the System Configuration API, you can do so from this link: https://decibel.ni.com/content/docs/DOC-13216
    You can add the library to your myRIO in the Add/Remove Software menu in NI-MAX.  Instructions for installing software using NI-MAX can be found here: http://zone.ni.com/reference/en-XX/help/373925A-01/myriohelp/myrio_advanced_config/
    Regards,
    Kelly B.
    Applications Engineering
    National Instruments

  • 39L4363D - Unable to set padding time for recording start and end time

    Hello,
    I have a problem with my 39L4363DG tv (Software 7.1.90.34.01.1).
    I'm not able the set padding time for recording start and/or end time as described in the [manual|http://www.toshiba-om.net/LCD/PDF/English/L4363-323950-English.pdf] on page 51. Both menu item "start padding time" and "end padding time" are disabled?
    Can anyone help me and give me an advice on how to solve it?

    Hi
    The padding time can be set for programmed recording.
    There is also an scheduling priority
    If scheduled time slots are next to each other and there is more than one minute between the end time of the first schedule and the start time of the next schedule, programmed recording will be performed correctly.
    When +Start Padding Time+ and +End Padding Time+ are set, the start time and end time will be the time plus the additional minutes.
    If scheduling times overlap, priority will be given to the programmed recording which starts first.
    When the programmed recording that started first ends, recording will switch to the next scheduled programme.
    At this time, depending on how far the scheduling times overlap, the beginning section of the next scheduled programme may not be recorded.

  • Difference between OMS system time and Agent system time is 117 mins and ha

    Hi Guys,
    In one of my office server i have changed the system time.After changing the time i have got this below alert.
    Could please help me out...

    Please, provide more details:
    1. Is the agent and OMS on the same machine?
    2. If different, is the system time on both machines identical?
    3. What is the operating system for OMS and agent?
    -- Sergiusz

  • I have the IPAD3 and have set uip to receive both personal and work emails - I want to password protect both so children cannot access - is this possible ?

    I have the IPAD3 and have set up to receive both personal and work emails - I want to password protect both so children cannot access - is this possible ?

    You can Password protect your iPad, but if you want your children to play games on your iPad, then one you unlock it, they have full access, there is not an option to password apps, such as the Mail app.

  • Setting System time

    How to set system time using java?
    When I use VC ++, I can call as.....
    char sz[MAX_PATH + 1];
         int len = GetSystemDirectory(sz, MAX_PATH);
         sz[len ++] = '\\';
         sz[len] = '\x0';
         strcpy(sz + len, "timedate.cpl");
         ShellExecute(NULL, "open", "control", sz, "", SW_SHOW);
    thus I can set the system time using Day/Time Dialog..
    But how can we set the system time in java?
    Have a same time dialog for us to use?
    Or what is the API or class we can set the system time
    directly?

    You can use Runtime.exec() to do this in a very similar way. You should not need to worry about getting the system directory since it should be on the path.
    Chuck

  • HT1776 I have the Energy Saver setting set to NEVER on both options, and my computer STILL goes to SLEEP after 1 hour. Please help!

    I have the Energy Saver setting set to NEVER on both, and my computer STILL goes to SLEEP after 1 hour. Please help!
    My COMPUTER goes to sleep and disrupts my apple tv all the time. How can I fix this?

    That you are getting the BONG is a good sign, it's unlikely to be hardware if you are able to hear that.
    Start by running SW update. It's not that there is a specific fix, but when updating it may rewrite some system files which may get this going again purely as a side affect. Worth a go, and should not harm the system.
    Try reset the PRAM - Resetting your Mac's PRAM and NVRAM
    Hopefully one of these quick fixes works, otherwise we'll need to try isolate the issue next - so if still having a problem, I'd try create a new user and login as that user to see if the issue persists (which will tell us if it's system wide or user specific)

  • How to set system time from Terminal while booted from 10.6.3 server install disk?

    I'm installing from a 10.6.3 server install disc onto a Mac Mini.  However, the battery on this Mac Mini is pretty much dead, forcing the system time back to 1/1/2001.  Through some research, this has created a problem in that I cannot move beyond the Welcome screen during setup of OS X server.  It looks like the binary has issues with the system time being older. 
    But I'm stuck in that I don't know how to adjust the system time from the Terminal Utility on the boot CD.  Can anyone help? 

    Hey, i just run in to something similar, tonight while trying to fix a computer.
    The user set the time and date on his computer to 1998 and computer locked everything including time and date in system preferences, and his user account basicly making him from administrator to guest. he could not almost any program properly that required administrator privilages.
    to fix this we used this comand in terminal " sudo date 201703162014 "    todays time and date
    20:17 03/16 2014
    we tryed everything and this fixed in 2 seconds
    ps: when you type sudo in terminal it whil give you a warning the improper use of this command is bad.... click continue.otherwhise you will not be able to execute the command.
    thanks again for this post and have a great day

  • System time for Java Stack and ABAP Stack of PI

    HI,
         We have a scenario in which we have a synchronous flow of data. In the forward flow we have used field UZEIT in an RFC Lookup to register the inbound time and in the reverse flow we have used current time function of SAP PI mapping. PI time is the local time of the server, However UZEIT is 4 hours ahead compared to PI time.
    Both the Java and the Abap stack are installed on the same server.
    Kindly let us know the reason for the difference in time on both the stacks.
    Regards,
                Milan Thaker

    Hi,
       Yes I am refering to the System->Status time in ABAP Stack. Could you please tell me where can I check the System time of JAVA stack. I got one XML file in UME which refers to some timestamp in com.sap.security.core.usermanagement but I failed to locate this field. Please let me know where can I find the Java stack time and how can that be synchronized with ABAP.
             Also, is there any time zone settting in JAVA for UTC , the way we have in ABAP
    Regards,
                  Milan Thaker

  • TimerThread problem after setting system time

    Hi,
    We are creating an application where we schedule some jobs in timer thread. Say I have scheduled a job after one hour and in between I have changed the system time. Then timer thread excecutions are not happening properly. While resetting the system time we are restting the JVM time also by Calender.setTime(Date). Please tell me what went wrong in this case.
    Thanks in advance,
    Champak

    Did you check this bug report:
    [java.util.Timer.scheduleAtFixedRate() fails if the system time is changed |http://bugs.sun.com/view_bug.do?bug_id=4290274]
    javachampak wrote:
    ... While resetting the system time we are restting the JVM time also by Calender.setTime(Date). ...
    This does not reset the jvm time, it sets the time of this calendar instance as described in the javadoc.

  • How do i plot with the operating system time in one plot and show lines between cursors in another using the same XY graph?

    I am having some trouble graphing two plots at once. One plot is to show the current temperature inside a chamber as a function of time. I am trying to pick the current time and temperature each second and plot it with each point being connected by a line. I am able to show a moving, blinking dot each second but I can't figure out how to develop an actual line with these dots. To make matters worse, the blinking dot is back in the year 1903. I understand that it uses seconds elapsed since 1903, and am trying to find out how to graph the current temperature with the system time.
    The second plot is just 5 moveable cursors that are to be connected by a line. I am able to move the cursors and retrieve the position information, but I can't make a line between them.
    I have attached my main .vi, though you may have to pick the graphing part off to have it work for you.
    Attachments:
    Main Module Chamber Testing I_O every 30 sec.vi ‏288 KB

    You're not creating the XY graph data correctly. I've attached an example with a couple of simple XY Graphs. One is using a couple of shift registers to hold the spearate x and y arrays. I think this is what you were trying to do. The other one uses a VI from the shipping examples called XY Chart. It makes an XY Grpah act like a chart. I've also shown the correct way to display current time.Message Edited by Dennis Knutson on 05-12-2005 03:51 PM
    Attachments:
    XY Graph.vi ‏41 KB

  • Program to Set System Time in Java

    Is there any way to set the system time through Java. If there is can you help me some information.
    Regards,
    Shivakumar Thota

    Hey Hey,
    You could run Runtime.exec() to execute a command such as VBScipt to do it.
    Other than that you may have to take a look at Java Native Interface(JNI) that will basically take control of doing anything you need.
    Also, You may want to post this in "New To Java" or some other forum other than Java Web Start. You'll get more people to help ya.
    Hope this helped,
    --Ryan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Setting system properties: difference between "-D" and "System.setProperty"

    Hi.
    I have a program that relies on the jogl library to display graphics. Internally, jogl loads a native library from disk, with a System.loadLibrary() call. In turn, loadLibrary searches the paths in the system property "java.library.path" to find the jogl DLL/SO files. So, it is my responsibility to ensure that the "java.library.path" property is correctly set.
    There are two ways that I know of to set system properties: as an argument to the JRE via the "-D" option and from within an application with the System.setProperty method. However, I have noticed that only the former gives the desired behavior. That is, if I do:
    java -Djava.library.path=lib MyProgram{code}
    the code in jogl.jar is able to successfully find and load the native libraries in lib/, but if I do:
    {code:java}System.setProperty("java.library.path", "lib");{code}
    at the beginning of main in my program (before the classes requiring jogl are loaded), I end up with an UnsatisfiedLinkError.
    Why does this happen? Why do the 2 methods produce different results? Is specifying native library paths on the command line the only way to ensure that they are found?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    See the [System Properties Tutorial|http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html] section on "Writing System Properties" which says:
    Warning: Changing system properties is potentially dangerous and should be done with discretion. Many system properties are not reread after start-up and are there for informational purposes. Changing some properties may have unexpected side-effects.
    Also see the [setting java.library.path property in java code|http://forums.sun.com/thread.jspa?threadID=627890] thread in the JNI forum.

  • Setting up time capsule for storage and printer, but not internet

    Hi all. I am a new mac user and got time capsule yesterday. I am only using it as storage and USB printer; not for an internet/network use. During setup, I didn't see any option to configure it this way. I did a backup successfully, but the amber light blinks continuously....I am assuming because there's no ethernet/modem? But if I don't intend to use it for that, is it normal for it to always blink amber? Should I find a way to tell it that it's not to be used for that? Or do I just ignore it and live with the blinking light? Thanks.

    Paul's suggestion did work - thank you!
    However, my anal retentive personality still wonders why there's not a more intuitve phase in the setup process that allows the user to clearly define what they're using it for....i.e. rather than manually override an "error".
    Of course, i do have new questions, too -
    If the capsule is connected to a computer both wirelessly and with ethernet, which is the preferred/default connection used?
    The setup tells me to update firmware, but i haven't yet and it seems to be running fine....any recommendations?

Maybe you are looking for