gpt4 book ai didi

nginx - 在nginx中获取自纪元以来的当前时间字符串(秒)

转载 作者:行者123 更新时间:2023-12-02 03:28:44 24 4
gpt4 key购买 nike

在 nginx 配置文件中,获取包含当前时间字符串表示的变量的最佳方法是什么?从概念上讲,我想要这样的东西:

$timestamp = <unix_time>;
add_header Time $timestamp;

应版主要求,这不是重复

Is there a way to get the current time in nginx?

作为变量 $date_gmt 和 $date_local 不提供自纪元以来的秒数格式。

最佳答案

根据 the docs ,它在 $msec 变量中。

关于nginx - 在nginx中获取自纪元以来的当前时间字符串(秒),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52456768/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com