import time
import math


def last_modified_from_epoch_ns(epoch_ns):
    """
    Convert a Unix timestamp to an IMF-Fixdate timestamp.

    :param epoch_ns: Unix time, expressed as an integral number of
                     nanoseconds since the epoch. Note that this is not the
                     usual Unix convention of a *real* number of *seconds*
                     since the epoch.

    :returns: Last-Modified header value in IMF-Fixdate format as specified
        in RFC 7231 section 7.1.1.1.
    """
    return time.strftime(
        '%a, %d %b %Y %H:%M:%S GMT',
        time.gmtime(math.ceil(epoch_ns / 1000000000.0)))