小编qaz*_*qaz的帖子

get UTC date (not UTC string) in javascript

I want to get utc date using moment or any other possibilities. utcString = moment.utc(someDate)).format() is giving utc string not utc date. I am not able to perform operations like utcString.getDate() , etc using this. Please help me in providing with utc date object.

moment.utc(new Date()).toDate() 正在将日期再次转换为我的当地时间。

例如:我希望将 utc 格式的字符串"2019-10-31T00:00:00.000Z"转换为 utc 日期并执行getDate(), getFullYear()可以使用 Date() 对象执行的操作(如等)

javascript utc momentjs

6
推荐指数
2
解决办法
7083
查看次数

在没有任何插件的reactjs中下载zip文件

我收到来自rest api的响应,其Content-Typeistext/htmlContent-Encodingis gzip

我尝试使用 blob 下载它

const blob = new Blob([res], { type: 'application/gzip' });
const downloadUrl = URL.createObjectURL(blob);
const a = document.createElement('a'); 
a.href = downloadUrl;
document.body.appendChild(a);
a.click();
Run Code Online (Sandbox Code Playgroud)

但下载的 gz 文件无法打开(似乎已损坏)。有人可以帮我下载 .zip 文件吗reactjs

编辑:需要一个不使用任何外部插件的解决方案

zip gzip reactjs

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

gzip ×1

javascript ×1

momentjs ×1

reactjs ×1

utc ×1

zip ×1