Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获得已发布帖子的 unix 时间戳(“the_date”或“the_time”函数)?
只需传入 Epoc 参数即可。the_time()将输出字符串;get_the_time()会将其返回到变量中以供其他地方使用。
the_time()
get_the_time()
$timestamp = get_the_time('U');
很简单:
$unixTimestamp = time();