Set date and time in UNIX

what is the command for RunTime.exec() to set date and time in UNIX.
please help me example
thanks in advance

do you mean like this
Runtime.getRuntime( ).exec("date -s "Tue Oct 23 20:27:26 PDT 2001"")
anyone who found this is wrong please tell me the correct command.

Similar Messages

  • How do I set date and time on apple tv?

    How do I set date and time on apple tv?

    Fixed the same problem, STEPS
    1. Reset your apple TV
    2.It will again stuck on that setting, ignore it by press menu
    3. Unplug ethernet wire
    4. Try to connect with wifi, it should be work with wifi connection as mine.
    5. Then you can switch back Ethernet wire after get fixed.
    Thanks. Lemme know dude if it's work.

  • Setting date and time in java mail

    I want to set date and time for the mail sent by my application.
    So how to set date and time for my mail.

              msg.setSentDate(new Date());Where msg is an instance of javax.mail.Message.

  • "RT Set date and time" does not set seconds in UTC mode

    Hallo,
    I tried to set the time on my cRio 9012 with the function settimeUTC which is used by the "Set Date and Time" vi. But the seconds I enter are ADDED to the current time and not set as new value.
    Even the vi shows this behaviour: I set up a vi in which the time is set in a loop (100ms delay) and read again. When I set local time the clock stops (as expected) but when I set the UTC time the seconds keep on running...
    Can anybody help me with that problem???
    Thanks
    Florian
    Solved!
    Go to Solution.

    Hi Andreas,
    well it does not matter if I set a time zone in the MAX or not. In my example I was working on UTC + 0 but even when I set it to my local time (UTC + 1) I get the same behaviour modified by one hour.
    My LabView Version is 8.5. In in the MAX under Software-> LabView-RealTime it says that I am using 8.5.0.
    I suspect  that the settime.out which is installed on the cRio is probably the root of the problem as VxWorks itself does not offer a function (at least I did not find one) to convert from broken down system time to system time in seconds. There only exist one to convert from broken down local time to system time in seconds ( mktime() ). The reverse function is available for both cases: gmtime() and localtime(). I also did not find a way to find out the offset of the local time. So I have to use the library function settimeUTC() from settime.out.
    As I offered I can send you the settime.out file from my cRio for reference or maybe you can tell me how to find out what the version of the file is. It seems not to be an ELF file as I looked inside it to find some timestamp or version info...
    Thanks so far 
    Florian

  • Is there a way to force time can only be set to "Set date and time automatically"?

    I am using OS X 10.9 .5 , and here is what I want to do.
    When you click "Open Date & Time Preference", you will find an option that states "Set date and time automatically". And of course you can chose not to do that, and adjust the time.
    But can you remove that option? So your OS X is forced to chose the mode "Set date and time automatically" no matter what you do? (aka you can't adjust the time by yourself now.)
    Is that possible? Is there an app that can achieve this goal or can you do that at Terminal?
    Thanks in advance.

    There's a similar setting in iPhoto preferences (in iLife '08 versions and later), or in Image Capture preferences (if you're using iLife '06 or earlier). Check those settings as well.

  • How do I change the "Set Date and Time Automatically" server

    Is there a way to change System Preferences/Date & Time/Date & Time/Set date and time automatically from "Apple Americas/U.S. (time.apple.com)" to another time server instead?

    sig wrote:
    The menu has a drop down. But if you know the address of another time server I would think you can type it in.
    Yeah, that's not really a menu, but a "combo box", which is a combination of an edit field and pop-up menu. So you can choose from existing items or just type in whatever time server you want.
    charlie

  • TS4268 I changed set date and time automatically to "no" and I was able to activate iMessage. This seems contrary to all the troubleshooting discussions I've been reading.

    Is there any definitive info on this subject?

    When ATV is setting date and time, and hangs there, it usually indicate there isn't a network connection.  Is your router still working, is the Internet for all the other computers on the same network working?  Have you tried changing from WiFi connection to Ethernet or vice versa?

  • Keychain problem and "Set date and time automatically"

    Something very strange appened to me today. I spent a few hours to get it through.
    All starts when I decided to open System Preferences and *set date and time manually* (I lost date and time because I left my PowerBook without its battery for an hour). At the next login, Leopard was no more able to access keychain's stored passwords, even if all items on Keychain Access were right there. Everytime I tried to read one item's password, a pop-up window reminded me that I had not the right to do it. As soon as I set back "date and time" on automatic (time.euro.apple.com - for me) all became normal (all iCal reminders appeared at on time) and all services started to get their passwords from the stored list.
    Sorry for my English (I'm from Italy).
    Someone got the same issue?

    That looks like the correct IP address for the Apple NTP. Not sure why your AEBS is not getting the time stamp.
    Would you mind double-checking the following setting, using the AirPort Admin Utility?
    AirPort Tab - Base Station Options: Logging/NTP
    - Set Date & Time Automatically: time.apple.com (checked)
    Is it possible that you have UDP blocked on port 123? Is your AEBS connected to another Internet router?

  • Set date and time

    I recently updated the apple tv .It was fine after the update although i did not use it as i was on my way out after the update.Days later when i put in on it cant seem to open itunes.reason being network time cannot be updated.i tried sighning out and now i cant sighn in.I tried reset that just brings me to a halt on screen that says activating setting date and time.Does any one know whats going on.Is the time server down ? Or something .Itune store sighn in works well in my pc ,ipad and other devices no problem.
    And i tried putting off all firewalls in router but no luck.
    Its connected wirelessly to the same router which normally works
    Any idea guys

    HI
    I have tried everything possible such as router firewall settings changing DNS servers using WIFI and ETHERNET nothing works.Waited for more updates nothing so far.The only solution is to down grade the firmware through itunes .Using now 5.0.2 works like a charm .Don't wait any longer just search apple forum for procedure and follow.Use a mac better.It takes only 5 minutes for the process.All you need is a mac or windows pc,usb cable,the type that goes behind the apple tv,(I used a blackberry bold 9900 original cable),software known as ipsw.YOU DONT NEED TO POWER THE APPLE TV WHILE DOING THIS.IT WILL LIGHT THE LED FROM PC POWER.GO TO https://discussions.apple.com/thread/4419016?start=0&tstart=0  Read procedure written by cwlown .JUST MAKE SURE FOR MAC HOLD OPTION KEY DOWN THEN CLICK RESTORE .POINT TO THE DOWNLODED ipsw AND RUN.FOR WINDOWS HOLD SHIFT THEN CLICK RESTORE .POINT TO Ipsw download and run.There is no neen to unzip or extract ipsw.I had a problem when using windows xp ipsw did not show up as an upgradeable firmware therefore could not run it.I did not want to waste time and used the mac instead.I think renaming the ipsw in windows could have cleared the problem.Another thing is after the downgrade itunes will say that your APPLE TV is restored to its factory defaults don't worry the job is done ,check your software on the APPLE TV THROUGH your tv LOCATED at general then about.SETTING up the ATV first connect the wifi or lan cable select location first THEN sign in.

  • Set Date and Time Automatically...doesn't

    We've noticed that the setting to automatically synchronize date and time to Apple's time server doesn't work if the system preference is 'locked'
    In other words, if the user that's logged in currently, isn't an admin user, then the machine doesn't set the date and time automatically.
    As soon as you unlock the system preference by clicking the padlock at the bottom, the date and time sync as they should.
    Anyone else noticed this?

    We do want the clock correct. The issue here is that the internal clocks drift - as I understand it, this is the one of the main reasons behind using a network time server.
    With the Date and time preferences set to 'Set date and time automatically', the but with the lock at the bottom corner locked- it's as though being locked is preventing the automatic date and time settings from updating.
    But the preference is checked on, and so the clock should be 'resetting' itself as necessary.
    To give an example- say the machine has been off for a while, and unplugged. This will cause the machine not to know what the Date and Time is. When the machine starts up, the preference should kick in, and the machine should 'Update date and time' automatically.
    But it doesn't. So long as that padlock is locked, even though the preference is checked on, the machine will not alter the date and time - until the padlock is unlocked.

  • What happened to the Get/Set Date and Time utilities from RT 7.1?

    I'd like to use the Get/Set Date and Time utilities that were available in 7.1, but disappeared after that. I see that the 7.1 utilites  call a dll that does not appear to be installed with LabVIEW RT 8 and later. What do I need to do to use the utilites from 7.1 that do not appear in later versions?

    In Labview 8.2 and later there are two directories for vi.lib. settime.dll is located in National instruments\Labview 8.2\Targets\NI\RT\ vi.lib
    This is the dll you want to use in order to call it use the same Vi as in 7.1 (RT set date and time.vi) and link it to the correct dll.

  • I bought my apple tv in USA and use in Indonesia, but I can't set date and time.

    How to set date and time so I can Home sharing with apple tv .

    Call the shop in NYC and find out.

  • The apple tv is stocked at setting date and time

    I Updated the Apple TV and now it requested to start the configuratio all over again and is stocked at setting date and time, can somebody help me?

    http://appletv2.com/stuck-on-setting-date-and-time-fix/

  • Geting and setting date and time in oracle using jdbc

    can u send me a sample snippet which shows me how to set date and time to a column in oracle database where the column datatype is date.
    and also send me the sample code to get the date and time from the above said column
    thanks in advance

    If you want DATE with time normalized to midnight, use java.sql.Date. If you really want time, with hours/minutes/seconds/millis, use java.sql.Timestamp.
    As for the best way to interact with the database, use java.sql.PreparedStatement and its get/setDate and get/setTimestamp methods. Those will escape dates for you properly.
    Look for a JDBC tutorial on-line to see how to do this, or http://www.javaalmanac.com for the java.sql package examples.
    %

  • I am getting a message "setting date and time...." but nothing happens

    My Apple TV has stopped working. I start up and it says "setting date and time...." but I cannot access the internet.

    Assuming this is not the first time you have used your Apple TV
    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
    Also try restarting the router.
    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If restoring from the Apple TV doesn't help, try restoring from iTunes using a USB cable.
    If this is a new Apple TV, in addition to trying the above, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

Maybe you are looking for