jUI TimePicker 和 MySQL DATETIME 列

发布于 2024-09-11 03:07:13 字数 408 浏览 3 评论 0原文

我正在使用 Martin Milesich TimePicker,它基本上是带有小时/分钟滑块的 jUI 日期选择器。

我对此有几个疑问:

1)我将数据存储在 DATETIME 类型的数据库字段中 - 正如您可能知道该字段的默认格式是2010-07-19 14:00: 00。然而,在我的表单字段中,我以更友好的方式显示日期/时间,即19/07/2010 14:00(英国格式)。那么在发布表单后如何将我的友好格式转换为MySQL格式呢?

2)可选地,时间部分是否可以输入到其自己的字段中?我查看了 timepicker.js 文件,注意到一个设置“altTimeField” - 它说是一个“用于存储时间的备用字段的选择器”,但到目前为止我还无法让它工作。

谢谢。

I'm using the Martin Milesich TimePicker, which is basically the jUI datepicker with hour/minute sliders attached to it.

I have a couple of queries regarding this:

1) I'm storing the data in a database field of type DATETIME - as you're probably aware the default format for this field is 2010-07-19 14:00:00. In my form field however I am displaying the date/time in a more friendly way, i.e. 19/07/2010 14:00 (uk format). So how can I convert my friendly format into the MySQL format after posting the form?

2) Optionally, is it possible for the time portion to be inputted in to its own field? I looked in the timepicker.js file and noticed a setting 'altTimeField' - which it says is a 'Selector for an alternate field to store time into' but so far I have not been able to get this to work.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见你 2024-09-18 03:07:14
$mydatetime=date('Y-m-d H:i:s', strtotime($mydatetime));
$mydatetime=date('Y-m-d H:i:s', strtotime($mydatetime));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文