[Ilugc] Help required for date manipulation in linux
- From: tshrinivasan@xxxxxxxxx (Shrinivasan T)
- Date: Tue, 8 Jul 2014 16:49:55 +0530
I am working on script creation for user audit report and last command
doesn't o/p the year.
I need to find year of the given date of month and day on linux box.
Need to check only for past 10 years.
example :
input = Thu Apr 15
Required o/p 20140415
Any unix/linux commands or perl function would be good.
The following python snippet can help you.
sudo pip install timestring
python
import timestring
print timestring.Date('Thu Apr 15')
2014-04-15 00:00:00
Source:
http://stackoverflow.com/questions/466345/converting-string-into-datetime
--
Regards,
T.Shrinivasan
My Life with GNU/Linux :
http://goinggnu.wordpress.com
Free E-Magazine on Free Open Source Software in Tamil :
http://kaniyam.com
Get CollabNet Subversion Edge :
http://www.collab.net/svnedge
Other related posts: