import pytz
from datetime import datetime


def unixepoch2datetime(unixepoch):
    """Given a timestamp in milliseconds, it returns a datetime object.

    Parameters
    ----------
    unixepoch : int
       Timestamp at millisecond precision

    Returns
    -------
    time : datetime
       Datetime object corresponding to the original timestamp
    """
    unixepoch = float(unixepoch) / 1000.0

    time = pytz.UTC.localize(datetime.utcfromtimestamp(unixepoch))

    return time