互联网技术 · 2024年2月14日

解决momentjs本地时间与数据库utc时间相差8小时的方法

moment(getTime).utcOffset(8).format(YYYY-MM-DD HH:mm:ss);

UTC

获取UTC

moment().utc();

UTC偏移量

moment().utcOffset();

设置偏移量

以下是相同的

moment().utcOffset(“+08:00”);

moment().utcOffset(8);

moment().utcOffset(480);

文章来源:田珊珊个人博客

来源地址:http://www.tianshan277.com/817.html

$.getJSON(“/section/814.json”,function(data){var h = + data[0][title] + : + data[0][description] + ;$(#section-814).append(h);}); $.getJSON(“/section/637.json”,function(data){var channel_id =window.CHANNEL_ID ||0;var channel,default_channel;$.each(data,function(i,r){if (r.channel_id ==0) {default_channel =r;} if (r.channel_id ==channel_id) {channel =r;return false;} }) channel =channel ?channel :default_channel;if (channel &&channel.thumb) {var h =;$(#section-637).append(h);} });

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册