tkue
6/8/2017 - 12:59 AM

fn_get_timestamp_abbr.sh

#!/bin/bash

# YYYYMMDD
function get_timestamp() {
	numChar=5; # number of chars to take off end
	timeStamp=$(date +%Y%m%d);
	endChar="$((${#timeStamp}-$numChar))";
	echo "$(echo $timeStamp | cut -c1-$endChar)";	
}
get_timestamp