OrangeMadness
October 17th, 2013, 09:20 PM
The problem is that I have a given date, say 2013-10-17 05:10 and I want to get the previous hour: 2013-10-17 04:10
The closest I could find in forums is some awk date arithmetic, but I figured I will ask for an opinion also here.
I am trying to get a calendar like behavior
e.g.
2013-10-17 00:30 => 2013-10-16 23:30
2013-10-01 00:30 => 2013-09-30 23:30
Can't get anywhere near that in linux environment. Figured I could compile a small Java program and use the Calendar class to do only this task but then... The whole project has been written in shell script so far, wouldn't be nice to spoil it in the end.
Any ideas?
The closest I could find in forums is some awk date arithmetic, but I figured I will ask for an opinion also here.
I am trying to get a calendar like behavior
e.g.
2013-10-17 00:30 => 2013-10-16 23:30
2013-10-01 00:30 => 2013-09-30 23:30
Can't get anywhere near that in linux environment. Figured I could compile a small Java program and use the Calendar class to do only this task but then... The whole project has been written in shell script so far, wouldn't be nice to spoil it in the end.
Any ideas?