title: Bash - how to format a time-stamp variable to human readable format
body: <p>At the beginning of my script I set a variable <em>DATE</em>, which I need to use in different parts of the script and in different formats.</p>
  
  <p>My issue is to use the same variable but format it in different ways:</p>
  
  <pre><code>#!/bin/bash
  DATE=$(date +%s)
  echo "date in timestamp format: $DATE"
  echo "..."
  # some other actions that need time...
  echo "date start at: $(date $(DATE +%Y-%m-%d:%H:%M))"
  </code></pre>
  
  <p>this runs but outputs an error (<em>DATE: command not found</em>):</p>
  
  <pre><code>date in timestamp format: 1490884719
  ...
  &lt;script&gt;.sh: line 6: DATE: command not found
  date start at: Thu Mar 30 16:38:40 CEST 2017
  </code></pre>
  
  <p>how do I get rid of the error?</p>