title: Convert UTC time to unix time stamp in C
body: <p>I need to know the current UTC time and convert it to Unix time stamp.
  I tried using combination of <code>time()</code>, <code>mktime()</code>, <code>gmtime()</code> but not getting correct UTC time
  Following is the snippet I am using:</p>
  
  <pre><code>time_t now;
  struct tm  ts;
  char buf[80];
  now = time(NULL);
  ts = *gmtime(&amp;now);
  strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", &amp;ts);
  </code></pre>
  
  <p>This gives me following output as --> Time :: Sat 2015-01-10 00:14:34 CST which is adding 5 Hr 30 minutes into local time instead of subtracting 5 Hr 30 min.
  Can anyone tell me why this is happening ?</p>