gpt4 book ai didi

javascript - 将时间添加到日期值

转载 作者:行者123 更新时间:2023-11-30 18:20:30 25 4
gpt4 key购买 nike

我正在使用一个名为 mobiscrolljQuery 插件来选择日期,但问题是我还需要在结果中加上 15 分钟。

我有一个函数 p(j),它返回 08/28/2012 12:15 - 12:15(或仅返回 08/28/2012 12:15 - 很方便),但我需要 12:15 - 12:30。有什么想法吗?

最佳答案

根据mobiscroll documentation setDate 与 Date 对象一起使用。

参见 this link关于如何在 javascript 中使用日期对象。您不需要进行任何字符串操作。

在你有正确的日期之后使用 .scroller('setDate',newDate,true);

关于javascript - 将时间添加到日期值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12156074/

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