as usual been reading several web pages and I can not find whats wrong with this command:
if as root I do
date --set="20111201" +"%Y%m%d"
it works, but if I do:
root@darkstar:/home/rudy# date --set="2011120116" +"%Y%m%d%H"
date: invalid date `2011120116'
What I want is to create a user script to change only the date, not the time.
this is the complete script I have done so far:
Code:
#
echo -n sudo date +%Y%m%d%H%M -s>resultado
cat resultado
echo
echo -n $1$2$3>>resultado
cat resultado
echo
date +%H%M>>resultado
cat resultado
echo
chmod +x resultado
./resultado
quick update:
root@darkstar:/home/rudy# date +"%Y%m%d%H"
2011120216
it works. something is wrong with the --set option, a bug may be?