linux convert time(for different timezones) to UTC

c, gcc, linux, timezone

Solution

`date -u -d "Tue Dec 14 10:30:23 PST 2012"` reports `Fri Dec 14 18:30:23 UTC 2012`. The discrepancy is because Dec 14 2012 is in fact a Friday, not a Tuesday. It probably works better with valid input...

Problem

Is there a way, in linux, to programmatically get UTC time for a given time string like ``` Tue Dec 14 10:30:23 PST 2012 Tue Jan 4 11:30:23 EST 2013 ``` to a UTC time, irrespective of( and without changing) local time zone settings?

Original source

Related problems