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() 对象执行的操作(如等)
我收到来自rest api的响应,其Content-Type
istext/html
和Content-Encoding
is 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
?
编辑:需要一个不使用任何外部插件的解决方案