2
votes
4answers
241 views

How to use “date” to print tomorrow's day of the week

On CentOS 6 Linux I use date +%a in several cronjobs and scripts to generate logfile names like myprog-Tue.txt and this works well for me since many years. But now for one program I need to delete ...
0
votes
1answer
47 views

hardware clock is set but date command is displayed wrong date and time

I am setting date with settimeofday function my hardware clock is set perfectly but when i execute date command it shows me wrong date and time. but if i reboot the system than it show me proper ...
3
votes
2answers
183 views

How do I pipe output to date -d “value”?

I have a date like "2014-01-30 05:04:27 GMT", and if I run date -d "2014-01-30 05:04:27 GMT", the output is in my server's timezone ("Thu Jan 30 16:04:27 EST 2014"). With the use of grep and cut, I ...
1
vote
1answer
547 views

Timezone setting in linux

I'm setting timezone GMT+6 in my linux machine by copying zoneinfo file to /etc/localtime but date command showing time UTCtime-6, can any one explain me this behaviour? I'm assuming date command ...
-1
votes
3answers
164 views

convert text file column field with data dd.mm.yy to dd.mm.YYYY

How to format date for file content using linux command line tools? Input: aaa;1.70;ccc;20.01.13;zz;2013; uuu;2.70;lll;17.12.10;zz;2013; fff;3.70;nnn;31.01.98;zz;2013; auu;8.70;nuu;30.02.96;zz;2013; ...
0
votes
1answer
83 views

Tar archive wrong creation date

I have a script to backup some directories: tar cjf /backup-`date +\%m-\%d-\%Y`.tar.bz2 mydir >> /dev/null 2>&1 At the end of the process, a "ls -al" show something like: -rwxr-xr-x 1 ...
2
votes
1answer
3k views

How do I get the current date according to an NTP server without setting it locally?

I want to get the current date and time according to a remote NTP server, using Linux. I don't want to change the local time as a result; I just want to get the remote date, adjusted for the local ...
0
votes
1answer
2k views

linux “date -s” command not working to change date on a server

date +%T --set="12:19:06" 12:19:06 date Mon Nov 26 12:37:32 SAST 2012 date 112613232012 Mon Nov 26 13:23:00 SAST 2012 date Mon Nov 26 13:42:27 SAST 2012 I have tried many different forms of this ...
1
vote
3answers
467 views

how to change the time format in Linux system

My Linux system has time format of UTC-5:0. How can i change it to UTC+5:30? Using date command i can able to change the time, but not the format
0
votes
1answer
236 views

How does `date` calculate time zone offset? [closed]

If I set the time zone environment variable: TZ="Foo/Bar", how does date handle different time zones and display the date accordingly?
0
votes
2answers
220 views

Set Linux date with ddmmyy

I need to set the date of a Linux box with a string I get from a program. This string is formatted as ddmmyy. Is it possible to use that directly or do I need to reformat it first? Currently I have ...
1
vote
2answers
204 views

Proper date -d “next monday”

I'm trying to write a quick script that figures out the date of the next Monday that isn't today. Although the date command accepts this expression, it appears to interpret it as equivalent to "this ...
13
votes
3answers
597 views

How to insert the date into vim

In vim you can execute comands with "!". You can combine that with "r" to insert the output into your current buffer. :r!date Fri Jul 20 09:39:26 SAST 2012 will insert the date into a file. ...
0
votes
0answers
221 views

Copying From Windows to NFS: Can The Timestamps Be Preserved?

We have a Linux server that has NFS shares. Some Windows hosts (XP & 7) connect to it via Services for UNIX. I've been told the behavior is different from XP to 7 in terms of file creation dates ...
1
vote
2answers
164 views

A download manager for Linux which saves downloaded files in directories by date like 2012_06_29

I've been using Download Master on Windows for years and what I liked most about it is that this program can automatically put downloaded files into directories by download date: /Downloads | ...
0
votes
0answers
574 views

Linux stuck one hour ahead (CentOS)

I use CentOS, and for some reason, one of the servers I bought (amongst a network of other servers I do not own) is off by one hour. The time is one hour ahead no matter what time zone I set it to. ...
2
votes
2answers
1k views

Set relative time using command line

Using something similar to the date command, is it possible to set the date and time relative to 'now'? So instead of something like date +%T -s "10:13:13" something like date -s +1h or something ...
2
votes
1answer
365 views

How to set-up date for cron weekly backup?

I'm writing a command for cron to do automatic backups for my flashdrive. I use tar ... -N <some date> to make the backup. The issue is how to write the command which gives me the right date. ...
1
vote
3answers
251 views

Linux date command is 4 minutes slow

I installed Centos onto my server and I noticed that when I compared the date command's output to time.gov (same timezones, of course), the output was 4 minutes behind. This also affects my ...
1
vote
2answers
18k views

How to change the date of Linux to UTC/GMT +1?

I need to change the date of my system. I'm running a Linux CentOS 5.6 # date +%Z UTC # date Thu Oct 6 11:42:45 UTC 2011 How to change the hour to be UTC/GMT +1? Best Regards,
0
votes
3answers
5k views

Ubuntu clock is wrong and I can't change it (running as VirtualBox Guest under OSX)

I have a strange problem with my Ubuntu Natty virtual machine running under VirtualBox on OSX. One day last week, my clock on the top bar in Gnome stopped displaying the correct time (I'm not running ...
21
votes
7answers
126k views

How to set current time on Linux?

Why is the output of the following commands different? root@vmi2115:/var# hwclock Sun 26 Jun 2011 01:21:38 PM CEST -0.273230 seconds root@vmi2495:/var# date Sun Jun 26 15:21:39 CEST 2011 ...
0
votes
1answer
819 views

Getting the week number based on date with different first day of the week in gawk

How to get the week number in linux using gawk with different first day of the week? the date command can give me the week number with +%V but it is based on Monday (1-53) or +%U (based on Sunday, ...
1
vote
1answer
272 views

On the command line, 'find' reports back an illegal time value

I want to run the following command. find . -mtime -60s When I do, I get this output instead: CLIENT% echo `date +%s`-1308741881 | bc 5152 CLIENT% find . -mtime -`echo `date +%s`-1308741881 | bc`s ...
10
votes
5answers
8k views

Store the output of date and watch command to a file

I am a newbie to linux and I am trying to watch a command and try to log it into a file. I tried watch -t -n 10 "(date '+TIME:%H:%M:%S' ; ps aux | grep "pattern" | wc -l)" >> logfile and am ...
3
votes
2answers
2k views

How to make an application detect if system time has changed in Linux

I need to write a small application which needs to detect if the system time is changed by an another application/user and perform some action as soon as it is detected (maybe log the data that time ...
1
vote
3answers
1k views

How to Change Server Date?

How do I change a Linux web server's date through SSH?
7
votes
5answers
5k views

How to convert from day of year and year to a date YYYYMMDD?

I'm looking to go from day of year (1-366) and year (e.g. 2011) to a date in the format YYYYMMDD?
5
votes
4answers
4k views

Timezone conversion by command line

I know about http://www.timeanddate.com/worldclock/converter.html I can't figure out how to query http://www.google.com in a sane natural format like "5pm BST in PST". Or do I have to write such an ...
1
vote
1answer
1k views

How to change time (Advanced Eastern Time) on Slackware 8.1

I have a linux (Slackware) machine and the time/date is like, June 23rd 2003, 10:00am (It's 11 here) and I am not able to set the time to have it correct. I change the timezome to Montreal but the ...