实现的效果如下:
1.使用javascript:
// 获取时间戳
const timestamp = 1628390400;
// 创建 Date 对象
const date = new Date(timestamp * 1000);
// 获取年、月、日、小时、分钟、秒
const year = date.getFullYear();
const month = new Intl.DateTimeFormat('en', { month: 'long' }).format(date);
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
// 输出英文日期格式
const englishDate = `${month} ${day}, ${year} ${hour}:${minute}:${second}`;
console.log(englishDate);
2.使用php: