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.

Similar Messages

  • Changing the System time in the JVM where Weblogic runs

    Hi,
    I am trying to change the System time where the Web-logic server (11g) runs using Mocking. I use "jmockit.jar" to mock the System.class. A Spring bean is created and through that I try to change the System time. I need to change the time for testing scenarios. For example, I need to backdate and do the testing for some scenarios. For the moment I do this manually and I want to automate this by changing only the time in the JVM where the application server runs. When I try to automate this using the Spring bean, I get an error as follows. Do anyone have any idea about this.
    [WLServer adminserver] Exception in thread "Timer-5" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "DynamicListenThread[Default]" java.lang.IllegalArgumentException: No class with name "com.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.logging.LogRecord.<init>(LogRecord.java:139)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:33)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:48)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:70)
    [WLServer adminserver] at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:63)
    [WLServer adminserver] at weblogic.logging.JDKLoggerFactory.createBaseLogRecord(JDKLoggerFactory.java:74)
    [WLServer adminserver] at com.bea.logging.LoggingService.log(LoggingService.java:216)
    [WLServer adminserver] at weblogic.server.ServerLogger.logListenThreadFailure(ServerLogger.java:205)
    [WLServer adminserver] at weblogic.server.channels.DynamicListenThread.run(DynamicListenThread.java:197)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "weblogic.timers.TimerThread" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at weblogic.timers.internal.TimerThread$Thread.run(TimerThread.java:256)
    [WLServer adminserver] Exception in thread "Timer-4" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
    [WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "Timer-1" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
    [WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "Timer-2" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "weblogic.time.TimeEventGenerator" java.util.MissingResourceException: Can't locate bundle for class 'weblogic.common.T3MiscLogLocalizer'
    [WLServer adminserver] at weblogic.i18ntools.L10nLookup.getLocalizer(L10nLookup.java:427)
    [WLServer adminserver] at weblogic.i18n.logging.CatalogMessage.<init>(CatalogMessage.java:47)
    [WLServer adminserver] at weblogic.common.T3MiscLogger.logThrowable(T3MiscLogger.java:325)
    [WLServer adminserver] at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:126)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    OR
    Do anyone know any other way to overcome this issue using some other mocking jar.
    Thanks
    Edited by: 913136 on Feb 8, 2012 2:32 AM

    Hi,
    I could manage to change the time in JVM where the Weblogic server runs. I loaded an Spring bean from my Test class and from that bean I set an offset (to shift the time) in the Mock class (say, MockSystem class). In this case I used the jmockit implementation for instrumentation purposes. The MockSystem class should not be instantiated by us and jmockit takes care of that part. What I had to do was defining the javaagent and another parameter ("-Djmockit-mocks=com.abc.common.service.impl.MockSystem") in the Weblogic server build XML (mentioned in the following URL[1]). But to work this the MockSystem.class file should be wrapped in a JAR file and included in Weblogic server/lib directory and define it in the Weblogic build XML file as a classpath. For more explanations visit this URL [2].
    [1]. http://jmockit.googlecode.com/svn/trunk/www/javadoc/mockit/Mockit.html#setUpStartupMocks%28java.lang.Object...%29
    [2]. http://code.google.com/p/jmockit/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Tool%20Type%20Status%20Priority%20Summary&groupby=&sort=&id=207
    Thanks
    -thiwanka-

  • Remove Local System from Change The System Time

    Hello,
    Is there any way to remove the Local Service account from policy "Change the system time"?
    I created a policy to only give permission for the Administrators and Power Users group, but when I run the AccessChk tool, the result is:
    administrators
    Power Users
    Local System
    Regards

    > Is there any way to remove the Local Service account from policy "Change
    > the system time"?
    No. Local System is the "godfather of your computer" and cannot be
    restricted.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • How to change the system time in (E-Business Suite)

    Hi,
    I need to change the system timings in E-Business Suite.
    My Database & Application is on different nodes..
    How could i change system timings on both...
    Thanks,
    Alig

    Alig,
    Changing the OS date/time will have no impact on the data (except for the scheduled jobs at the database and the OS levels). As mentioned in the threads I referenced above, you have to stop the application/database, change the date/time at the OS level, and start the application.
    The application is just an interface which connects to the database, so it gets all the data from the database server. However, if you want to change the date/time it has to be done on both nodes (stop all the services first as mentioned above).
    Btw, what is the point of changing the date/time because of Ramadan? The business requirement of your client does not make sense (how does it differ from the application/database perspective if you start working at 9:00 AM instead of 7:00 AM for example)?
    The steps in the document should be enough, and if you do not trust any of the replies here you could simply log a SR and confirm this with Oracle support.
    Thanks,
    Hussein

  • The impact of changing SAP system time zone.

    Hello gurus,
    We are in the company located in UTC+8 Time Zone. but during the system installation, the setting in SAP (tcode:STZAC) of the system time zone is CET, which is, not correct, and cause some issues: such as, when we try to send mail via SAP smtp, the sent time in the mail is always wrong.
    We tried to modify it to UTC+8, but since we already go live for several months, there're lots of application data in the system. Before that we need to make sure that this change will not affect the current implementation.
    Do you experts know the impact or risk of changing the system time zone after going live?
    Regards,
    Charlie

    Lets look at this from a logic perspective,  if your system is CET and you are moving to UTC+8 you are going a few hours ahead... so basically you'll find a gap in time in between the documents but you wont find any time conflict. So based on that it should be safe. You certainly need to check your jobs and make sure all necesary jobs will run so you can reschedule them if skipped by the time change (I guess).
    Regards
    Juan

  • Change of system time in SAP

    Hi
    We wanted to change the system time in SAP and we have already posted certain documents.
    Pls let me know, if we change the time.
    Will there be any impact on the posted documents
    Regards
    Madhan D

    Hi,
    Changing system time would ideally can have impact on transactional documents created.
    You need to ensure that there are no post dated open documents as it may clash with change in time.
    Eventuall changing the time post 12 mid night would be a good option.
    Hope this helps.
    Regards,
    Deepak Kori

  • Capture Time Changed by System Time Zone?

    Hi All,
       In Lightroom 1.4, changing the system time in Windows XP changes the capture time!
       This seems crazy...I take photos in different time zones, and have the camera set correctly in that timezone (or adjust it to be correct in Lightroom). I'd rather not change my system timezone to "Bangkok" to correctly see data for photos from Thailand.
       Anyone have a solution or workaround? Is this fixed in LR 2?
    Thanks!
       Alex

    This post seems to explain a lot.
    http://www.lightroomforums.net/index.php?topic=359.msg13336#msg13336
    So I'm stuck having Lightroom adjust times based on the timezone of my OS? Or is there a workaround?...maybe saving and re-importing metadata? (Can't get this to work either, even using some complex procedure I found using Exiftools and a batch file...)
    I can understand the capture time relying on the OS for timezone at the time of import, but Lightroom should not continuously adjust it every time you view...
    Thanks,
       Alex

  • When i change os system time to 1987 before, the database is crashed.

    What impact to oracle when change os system time? and how to do this?

    Question is why you want to do that?
    Some tester to do it, i need an explain to it.
    Did you already tried this and database crashed?
    Yes.
    Did you stop the database?
    No.
    What's Oracle version? OS?
    oracle
    11.1.0.7.0
    os
    SUSE Linux Enterprise Server 10 (i586)
    VERSION = 10
    PATCHLEVEL = 2

  • HT5639 The system time is always changing by about 7 hours

    I am running windows 8 64bit pro upgrade on my mac 27inch i2.7GHz. The system time is always changing by about 7 hours, I reset it by clicking on internet time update and it is OK until the next sync or if I restart then it goes back to being out by the 7 hours. Timezone setting are correct and language setting are all pointing to the correct zone/area. I have the latest bootcamp drivers installed too. Any help to get this fixed will really help as it is making my emails very hard to follow when I have noticed the change..
    Thanks

    I used the "Registry Fix" method in this article to fix it in Win7/64 on my BootCamp partition. Worked perfectly.
    http://prasys.info/2010/01/fixing-time-sync-issue-with-osxwindows/
    The article was written before Win 8 was supported by Bootcamp but, as the Registry fix is handled entirely within Win OS, it may work with Win 8.

  • How to change the default time?

    when you finish the action of dialing ,the CCM system recognize your finish after 10s .How to change the default time in Service Parameters ,which is the detail Parameters ?

    Please see the following link for information on configuring the interdigit timeout.
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_tech_note09186a00800dab26.shtml
    Hope this helps. If so, please rate the post.
    Brandon

  • Apple Mail, is there a way to change the default time-out?

    This has been puzzling me for some time and I have not found a solution. The problem which I also posted in the Mail forum (though I think that if there is a positive answer it will come through here) is as follows:
    I have an email account with on my company's mail server which is actually a Novell Netware server with a POP3 service. When using mail to send mail, I have no problems. When using mail to recieve mail, well, sometimes it gets the mail, and sometimes it does not. Usually, I can recieve mail for two or three weeks then it just stops working. No changes to my system, no updates or anything, I recieve email at one point in the day and then 15 minutes later - nothing. In the Activity Monitor, I see "Connecting to ..." then "Sending Password" then "Checking for Messages", then (after a while) it beeps as if it did not find any messages to download (no error!).
    Some weeks later, after suffering with webmail, suddenly, it works again. This usually coincides with maintenance on the server, but not always. It also seems to correspond with a general improvement of the server performance. But eventually, the cycle starts over again with mail suddenly not able to find any new messages for that account.
    I use dial-up at home, ethernet LAN at work, and DSL at our satellite offices. When it works on one it works on all. Also note that my other email accounts (not in any way connected to my company) work as they should at all times and in each setting.
    Is it possible that mail simply times out before the messages are discovered. The Novell server used for mail is by no means known for its performance. If so, is there anyway to change the default timeout in mail for "Checking for Messages"?
    Things I have tried:
    I have dumped the "MessageUidsAlreadyDownloaded" and "MessageUidsAlreadyDownloaded2" files to no avail.
    I have changed computers (I recently upgraded from a ti400), reinstalled the OS, upgraded from 10.2.8 to 10.3.x to 10.4.3, and removed and recreated the mail account (multiple times), all to no avail.
    Based on the above observations, I feel that it may be that "Mail's" "Get-mail" function is timing out before new messages are discovered on a very slow server. Is there any way to change the default time-out to evaluate this hypothesis?
    Any help would be appreciated.
    Kraig

    I already thought of that one.  I deleted my account from there.  But it didn't default to the other one.  It just told me I needed to add an account.  Thanks tho

  • How to display the Date Time using the System Time zone

    Friends,
    Can anyone help me with below scenario..
    I have to display Date Time on a jsff page, This value associated to one of Transient View object populated from the database.. Is there any way I can handle on the screen to display the same date /time bassed on the system time zone ?
    I know one way how we can handle it.. while populating to View object we can set the time based on the system time zone.. but it would be easy and simple if there is any approach I can use on UI layer itself..
    thanks

    I don't understand why this display doesn't pay attention to the date/time format settings that are set in the language and text prefs.
    Those settings are used for date OR time, and provide for different displays depending on the space available. The menu bar does not have a fixed space available, and wants both date and time.
    In Leopard, it used the medium time format. To get the date and time, you could modify that format to include the date, but that could cause problems with software that happened to use the medium time format and expectede just the time. Also, you might want to change the medium time format without changing the menu bar display. For these reasons, Snow Leopard's menu bar clock uses its own formatting for data and time display.

  • How to View Outlook Messages in Timezone different from the Systems Time.

    Hi Team,
    My Name is Abhishek. I am from India.
    I just want to know one thing related to MS Outlook 2007 Version.
    To deal with Hongkong customers and to work in database we have kept the systems time as HongKong Time (GMT + 07: 30) in my official Laptop.
    So. when I receive any email in the Inbox it shows the message received time in Hong Kong Time which is the systems Time right now.
    But As I stay in India, I just want to see my all Outllook received Messages in Indian Time (GMT + 05: 30), without disturbing the systems time.  I just get confused when I receive any email and it shows in systems Hong Kong Time.
    Is it possible to change my outlook message receiving display time to Indian time without disturbing my systems time...If so, pls help me by telling the procedure how to do it...
    Thanking You
    Abhishek

    Hi Abhishek:
    There are no
    Daylight saving time for  HongKong Time Zone and also for the Indian Time, so the checkbox will be greyed out.
    As
    Nezer mentioned above: “Adjusting the time zone in outlook also alters the system time, I think outlook is design to always mirror the time zone of you system clock.” We couldn’t change
    this within Outlook.
    Thanks for your understanding.

  • How to change the defrag times

    Can you change the defragmentation times because i dont want to leave my laptop on all night?

    MartyFromTauranga wrote:
    Can you change the defragmentation times because i dont want to leave my laptop on all night?
    There is no need to leave the MBook on over night. There are a couple of clean-up-scripts starting if the system is idle (cpu usage is under a specific value) and if system starts up / shoot down.
    If you (like I do) let the system run for weeks, by only putting the Mac to sleep state, it could be necesary to let the Mac run to idle state (first close all unneeded applications) every two weeks or so for a while.
    The HFS+ filesystem needs no "defrag" as HFS+ optimizes the filestructure "on the fly" when deleting or adding files to the drive.
    HFS+ uses a number of optimizations to the allocation algorithms in an attempt to defragment files while they are being accessed without a separate defragmenter.
    If (very unlikely in normal operations) the filesystem does become fragmented, the only way to defragment it is to use a 3rd Party tool; or to wipe the hard drive completely and install the system from scratch.
    Cheers - Lupunus

  • Java Thread.sleep(timeout) is influenced by changes to System time on Linux

    Java Thread.sleep(timeout) is influenced by changes to System time on Linux
    bugId : 6311057
    I encountered this problem in redhat6/ jdk 1.6

    890651 wrote:
    Java Thread.sleep(timeout) is influenced by changes to System time on Linux
    bugId : 6311057
    I encountered this problem in redhat6/ jdk 1.6At least half the time I use it, I'd want it to be, the other half I wouldn't care.
    What are you doing with it where this might be a problem?
    Changing the system clock abruptly can cause all kinds of problems with your system anyway, because various background activities etc. often depend on file dates. Wherever possible use the "skew" method to adjust your system clock, rather than just plonking in a new value, especially if you are setting the clock backwards.

Maybe you are looking for

  • While doing down payment request with PO (F-47)

    Hi, While doing Downpayment Request (Capital Vendors) with reference PO the system is showing below error. Contact your system administrator (table error) Message no. AA866 Diagnosis No account has been entered for posting down payments in area 01 un

  • Creating purchase order with bapi_po_create1

    hi , i am getting an error saying shippin details not maintained for the material ....which i have created by using bapi_material_savedata. where do i have to look for to fill the shipping data in bapi_material_savedata thanks and regards ,' mithun s

  • VOFM problem

    I am trying to modificate the net price in VOFM for a purchase order, but i need to know the position of the purchase requisition order that i put in the table control of me21n and when i make a get parameter of BAP parameter i don´t find the data, a

  • HTTP with RFC destination problem

    Hi, We're doing an SAP R/3 --> XI --> External System scenario. We've had no problems making the SAP R/3 to XI work. For XI to External System, we're using the Plain HTTP adapter with an RFC destination. The Server, Intermediate and Root CA of the Ex

  • AOL Desktop for Macs.  Anyone have used it?

    G4 Digital Audio Version used; supplied with clean HDD and now upgraded OS 10.4.11 I use AOL as an internet service provider for dial up. Don't knock it, but you can if u want I'm cool with people here. I use the dial up because I use two ISP and att