Convert a Unix timestamp to a date (and a date to a timestamp)

Convert a Unix timestamp to a readable date and time, or a date to a timestamp, in seconds or milliseconds.