-1

Given String:->

approximateLastUseTime: '2019-10-15T16:56:07.082500Z'

I need to extract everything after the T and before the Z (after the colon)

1 Answers1

0

With bash, you can use substring operator, or prefix/suffix

T=2019-10-15T16:56:07.082500Z

# Using substring
echo ${T:11:15}

# Using prefix/suffix
T1=${T#*T}
T1=${T1%Z*}
echo "$T1"
dash-o
  • 13,723
  • 1
  • 10
  • 37