Como converter o tempo epoch em uma data legível por humanos?

Python
import datetime
# Convert epoch to human readable date
epoch = 1631532000
human_readable_date = datetime.datetime.utcfromtimestamp(epoch).strftime('%Y-%m-%d %H:%M:%S')
print(human_readable_date)
Javascript
// Convert epoch to human readable date
const epoch = 1631532000;
const humanReadableDate = new Date(epoch * 1000).toISOString().replace(/T|Z/g, ' ');
console.log(humanReadableDate);
Java
import java.text.SimpleDateFormat;
import java.util.Date;
// Convert epoch to human readable date
long epoch = 1631532000;
Date date = new Date(epoch * 1000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String humanReadableDate = sdf.format(date);
System.out.println(humanReadableDate);
C#
using System;
// Convert epoch to human readable date
long epoch = 1631532000;
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(epoch);
string humanReadableDate = date.ToString("yyyy-MM-dd HH:mm:ss");
Console.WriteLine(humanReadableDate);
C++
#include <iostream>
#include <chrono>
#include <ctime>
int main() {
// Convert epoch to human readable date
long epoch = 1631532000;
std::time_t time = epoch;
std::tm* tm = std::gmtime(&time);
char buffer[80];
std::strftime(buffer, 80, "%Y-%m-%d %H:%M:%S", tm);
std::cout << buffer << std::endl;
return 0;
}
PHP
<?php
// Convert epoch to human readable date
$epoch = 1631532000;
$humanReadableDate = date('Y-m-d H:i:s', $epoch);
echo $humanReadableDate;
?>
TypeScript
// Convert epoch to human readable date
const epoch = 1631532000;
const humanReadableDate = new Date(epoch * 1000).toISOString().replace(/T|Z/g, ' ').slice(0, -5);
console.log(humanReadableDate);
Swift
import Foundation
// Convert epoch to human readable date
let epoch = 1631532000
let date = Date(timeIntervalSince1970: TimeInterval(epoch))
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
let humanReadableDate = dateFormatter.string(from: date)
print(humanReadableDate)
Ruby
# Convert epoch to human readable date
epoch = 1631532000
human_readable_date = Time.at(epoch).strftime('%Y-%m-%d %H:%M:%S')
puts human_readable_date
Go
package main
import (
"fmt"
"time"
)
func main() {
// Convert epoch to human readable date
epoch := int64(1631532000)
humanReadableDate := time.Unix(epoch, 0).Format("2006-01-02 15:04:05")
fmt.Println(humanReadableDate)
}