Sync Computer Time manually with Domain Controller
NET TIME %LOGONSERVER% /SET /Y
admin on August 27th 2013 in IT, Windows, Windows Server
NET TIME %LOGONSERVER% /SET /Y
admin on August 27th 2013 in IT, Windows, Windows Server
Easy way to extract the date and time for logging.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
@echo off cls rem Parse Date [19.08.2011] rem It needs to be adjustet to your time !!! set cur_yyyy=%date:~6,4% set cur_mm=%date:~3,2% set cur_dd=%date:~0,2% rem Parse Time [ 9:04:34.89] set cur_hh=%time:~0,2% if %cur_hh% lss 10 (set cur_hh=0%time:~1,1%) set cur_nn=%time:~3,2% set cur_ss=%time:~6,2% set cur_ms=%time:~9,2% rem Time Stamp Format set timestamp=%cur_yyyy%%cur_mm%%cur_dd%_%cur_hh%%cur_nn%%cur_ss% echo %timestamp% |
1. Install
apt-get install ntpdate
2. Create a new file in /etc/cron.hourly
#!/bin/bash
/usr/sbin/ntpdate your_timeserver >> /var/log/ntpdate.log
3. Give the file run rights
chmod +x file_name
Important: use two “-” before set!
1 2 |
date --set 1998-11-02 date --set 21:08:0 |
admin on January 28th 2009 in Linux