Hot answers tagged time
This: date +%s will return the number of seconds since the epoch. This: date +%s%N returns the seconds and current nanoseconds. So: date +%s%N | cut -b1-13 will give you the number of milliseconds since the epoch - current seconds plus the left three of the nanoseconds. and from MikeyB - echo $(($(date +%s%N)/1000000)) (dividing by 1000 only ...
http://www.pool.ntp.org/ If you are in the US: United States — us.pool.ntp.org To use this pool zone, add the following to your ntp.conf file: server 0.us.pool.ntp.org server 1.us.pool.ntp.org server 2.us.pool.ntp.org server 3.us.pool.ntp.org Other pools around the world are available and can be found at the http://www.pool.ntp.org/ site.
You may simply use %3N to truncate the nanoseconds to the 3 most significant digits (which then are milliseconds): $ date +%s%3N 1397392146866 This works e.g. on my kubuntu 12.04. But be aware, that %N may not be implemented depending on your target system. E.g. tested on an embedded system (buildroot rootfs, compiled using a non-HF arm cross toolchain) ...
The NTP algorithm includes information to allow you to calculate and fix the drift in your server's clock. NTPD includes the ability to use this to keep your clock in sync and will run more accurately than a clock on a computer not running NTPD. NTPD will also use several servers to improve accuracy. ntpdate does not keep any state to perform this service ...
It looks as if it was implemented recently for Quantal (12.10) : see http://brainstorm.ubuntu.com/idea/17829/ . Basically, dmesg is reported to have a new switch -T, --ctime. Edit. As another extension on Ignacio's answer, here are some scripts to enhance dmesg output on older systems. ( Note: for the python version of the code shown there, one will ...
You are correct that frequencies that high would be completely unmanageable. Sending one bit per frequency would cause problems for various types of radio transmissions as well. So we have modulation techniques which allow more than one bit to be send. A touch of terminology: baud, most people will remember that term from the days of telephone modems, is ...
A very simple way is to just replace the leading space with zero: echo %TIME: =0% outputs: 09:18:53,45
The Network Time Protocol, or NTP, can be used to synchronize the time on a server with an authoritative source. Windows Servers, for example, will use one of the network domain controllers (the DC which holds the PDC emulator FSMO role for the domain [thanks Graeme]) to get time information. You can configure the domain controller to get information from ...
It's a security feature to slow down people who are trying to guess your password. It takes Ubuntu the same amount of time to see if it's correct or not, but then it waits for a few seconds before letting you try again.
You can also do : dpkg-reconfigure tzdata It will then allow you to choose your timezone.
This is easy to control. Configuration management is the key... Ensure that the ntp service is running and configured... For example, using Monit to make sure ntpd is running and to restart it if it fails is an easy approach... It may make sense to add cron and other essential daemons to that sort of check. Another option is using a configuration ...
As Kyle said w32tm /resync is the modern way to do this. See this Link to Microsoft Knowledgebase for more information on the w32tm command. There is also net time which is an older version but perhaps easier.
Well for one your timestamps on all your logs will be off and out of sync with other servers making it very hard to figure out when things happened. Also, time synchronization is relied upon for some security protocols (kerberos for example). So what I'm saying is, most things will continue working normally, some protocols or applications relying on ...
If you're using Debian, xinetd comes with a ToD daemon. If you change the "disable = yes" like in /etc/xinetd.d/time to "disable = no" and then restart xinetd, you should be able to telnet to the server on port 37 and check that you get something returned. You can use something like: nc $IP 37 | hexdump and you'll see that the hex value increases every ...
As with most things, "it depends". Are all of your administrators/users in the same timezone? Perhaps their TZ would be appropriate. Do the machines interact with the local environment? Local TZ might be good. Are all the logs pulled to a central location for analysis? UTC might help there. Do the machines communicate with each other in ways where time ...
Set everything to UTC. In addition to the examples user48838 mentioned, most things related to aviation are given in Zulu time (same as UTC/GMT). e.g. flight plans are filed with takeoff and landing times in UTC.
Databases don't like backward steps in time, so you don't want to start with the default behavior of jumping the time. Adding the -x option to the command line will slew the time if the offset is less than 600 seconds (10 minutes). At maximum slew rate it will take about a day and half to adjust the clock by a minute. This is a slow but safe way to adjust ...
As Dentrasi has explained - this is to make it more difficult for the attacker to carry out a brute-force attack on the password store. In almost all circumstances, you don't to change this behavior. If you have a good reason to (which I can't think of), you can modify it via /etc/login.defs - See the login.defs(5) man page. FAIL_DELAY (number) Delay ...
Jeff, I found this article. Might be of some help to you. You might have already read this but I thought it was worth a shot. HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags This registry entry controls whether the local computer is marked as a reliable time server (which is only possible if the previous registry entry is set ...
Try monit. You could use a configuration like this, to accomplish your task: check process gameserver with pidfile /var/run/gameserver.pid start program = "/etc/init.d/gameserver start" with timeout 60 seconds stop program = "/etc/init.d/gameserver stop" if cpu > 80% for 2 cycles then alert if cpu > 95% for 5 cycles then restart if ...
Connecting your ntpd to NTP servers outside your LAN to time sync can lead to the inconsistencies you are seeing, because every connection will have to go thru several routers, each one with unpredictable latencies depending on traffic. If each server connects by itself, the time between all the servers will drift a little. To avoid the inconsistency, the ...
You can use the following command: w32tm /resync
Windows Time Agent is a free control panel applet for configuring the NTP server/synchronization ability of Windows. It acts as a front-end to the registry settings and lets you configure multiple NTP servers and see what sort of results you are getting from them in real-time. Not many people know about this particularly handy (and free) piece of software, ...
Is it this problem? You need to look at /etc/default/rcS and change UTC=yes to UTC=no. This makes Ubuntu read and write to the hardware clock in the same way as Windows, using local time instead of UTC.
This is a tricksy one, and it's actually a bug in rsyslog, specifically RepeatedMsgReduction On, and a change in behaviour with the version released with Trusty (compared to earlier versions) See http://bugzilla.adiscon.com/show_bug.cgi?id=527 for the gory details. In short, turn off RepeatedMsgReduction on Trusty. It's not helpful, and does dumb things.
Unless extremely accurate timekeeping is mission-critical for you there should be no discernible effect for your users, aside from their clocks changing by 2 minutes. The possible exception is if they declare your NTP server to be "insane" as a result of the large change (which would require you to restart the NTP service on the affected systems to force ...
date +%N doesn't work on OS X, but you could use one of ruby: ruby -e 'puts Time.now.to_f' python: python -c 'import time; print time.time()' node.js: node -e 'console.log(Date.now())' PHP: php -r 'echo microtime(TRUE);' the internets: wget -qO- http://www.timeapi.org/utc/now?\\s.\\N or for milliseconds rounded to nearest second date +%s000
You can resolve the problem by running NTP. If it isn't already installed you should be able to do something like yum install ntp chkconfig --levels 235 ntpd on service ntpd start You may have to give it a while to sync the first time.
Haven't tried this one out yet. But if this is current is looks like someone already wrote the library you can preload with libfaketime. The basic usage is: user@host> LD_PRELOAD=/usr/local/lib/libfaketime.so.1 FAKETIME="-15d" date Mon Nov 8 12:01:12 CEST 2007 You can use ltrace to make sure all the time functions your application uses are covered.
Only top voted, non community-wiki answers of a minimum length are eligible