You would be better off setting the time zone ahead of time:
SET time_zone="UTC";
select FROM_UNIXTIME(1277942400);
The reason is that conversions involving a local time zone can be lossy. There is an example of this in the docs here (see the 4th paragraph under the UNIX_TIMESTAMP() section starting with “Note:”)