如何在服务器中存储本地时间 [英] how to store a local time in server
问题描述
我正在尝试在Server中插入本地时间。但未能插入
因为我希望本地时间为yyyy-mm-dd HH:mm:ss (24小时)格式。但我转换错误
可以任何人帮助我..
谢谢高级..
通常在SQL服务器端更改日期格式 SET DATEFORMAT [ ^ ]命令。
< span class =code-keyword> SET DATETIMEFORMAT ymd;
INSERT INTO ...
但是如果你想使用JavaScript在客户端机器上获取本地时间,请参阅:
http://stackoverflow.com/questions/6838197/get-local-date-string-and-time-string [ ^ ]
如果您理解这个概念,只需阅读此查询
http://stackoverflow.com/questions/13207956/get-server-time-and-insert-into-mysql-table-via-a-表格 [ ^ ]
I am Trying to Insert the local Time in Server.But failed to insert
javascript日期和时间对象 [ ^ ]
JavaScript getTimezoneOffset()方法 [ ^ ]
JavaScript日期格式 [ ^ ]
问候......:笑:
as i want local Time as yyyy-mm-dd HH:mm:ss(24hrs) format.but I am conversion errors
can Anybody Help me..
Thanks in Advance..Usually to change date format on SQL server side SET DATEFORMAT[^] command is used.
SET DATETIMEFORMAT ymd;
INSERT INTO ...
But if you want to get local time on client machine using JavaScript, see this:
http://stackoverflow.com/questions/6838197/get-local-date-string-and-time-string[^]
if you understand the concept just read this query
http://stackoverflow.com/questions/13207956/get-server-time-and-insert-into-mysql-table-via-a-form[^]
Refer to these links
javascript date and time object[^]
JavaScript getTimezoneOffset() Method[^]
JavaScript Date Format[^]
Regards.. :laugh:
这篇关于如何在服务器中存储本地时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!