Thanks for your help. I already solved it. **My solution:** Use this simple bash script to get timestamp from `hwclock -D` command. function timestamp_from_rtc_get { tmp="$(sudo hwclock -D)" tmp=${tmp##*= } out=${tmp%% seconds*} echo $out } timestamp_from_rtc_get