Below is the code to get epoch time in shell script :
Code is self-explanatory for the shell script dev's.
startdate_ymd=`date --date="31 day ago" +%Y%m%d`
startdate=`date --date="${startdate_ymd}" +%s`
startdatemillis=`expr ${startdate} \\* 1000`
enddate_ymd=`date --date="1 day ago" +%Y%m%d`
enddate=`date --date="${enddate_ymd}" +%s`
enddatemillis=`expr ${enddate} \\* 1000`
Code is self-explanatory for the shell script dev's.
startdate_ymd=`date --date="31 day ago" +%Y%m%d`
startdate=`date --date="${startdate_ymd}" +%s`
startdatemillis=`expr ${startdate} \\* 1000`
enddate_ymd=`date --date="1 day ago" +%Y%m%d`
enddate=`date --date="${enddate_ymd}" +%s`
enddatemillis=`expr ${enddate} \\* 1000`
No comments :
Post a Comment