我想将当前时间/日期放入格式为 2011 年 9 月 27 日 19:19:09 的隐藏文本字段中
<input type="hidden" name="current_date" value="" readonly="readonly">
谢谢
最佳答案
<input type="hidden" name="current_date" value="<?php echo date('H:i:s M d, Y'); ?>" readonly="readonly">
但您应该知道用户可以轻松更改该值。
编辑: 使用 date_default_timezone_set设置时区。
此处列出了澳大利亚的时区:http://www.php.net/manual/en/timezones.australia.php
关于php - 将当前时间日期放在隐藏字段中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7577944/