title: Converting date with timezone in UNIX timestamp Shell/Bash
body: <p>I need to convert a date from string in the format "yyyy/mm/dd hh:mm:ss TZ" to  UNIX time (TZ = Timezone).</p>
  
  <p>What I have done so far is to convert a date in the format "yyyy/mm/dd hh:mm:ss" without a timezone to timestamp by using </p>
  
  <pre><code>dateYMD="2019/2/28 12:23:11.46"
  newt=$(date -d "${dateYMD}" +"%s")
  echo ${newt}
  </code></pre>
  
  <p>and I have the following result.</p>
  
  <pre><code>1551349391
  </code></pre>
  
  <p>My struggle is to find how both timezone and date/time can be converted to timestamp (unix time) . For example I need 4 variables with the same date/time as dateYMD but in 4 different timezones so that their timestamps would be different.</p>
  
  <p>Here is the latest I have tried</p>
  
  <pre><code>dateYMD="2017/09/09 08:58:09"
  timez=$(TZ=Australia/Sydney date -d @$(date +%s -d "${dateYMD}"))
  unixTimez=$( date --date "${timez}" +"%s" )
  echo ${unixTimez}
  </code></pre>
  
  <p>that showed me the following error </p>
  
  <pre><code>   date: invalid date ‘чт фев 28 21:23:11 AEDT 2019’
  </code></pre>