如何从moment js中提取国家名称以添加到对象中
我有以下内容,我正在格式化时刻日期并将其存储到对象中,如下所示
async date(){
var today=Moment() **// today gets stored as Wed Mar 16 2022 12:05:07 GMT+0200 (Standard Time)'**
var date= today.format("dddd,D MMM YYYY"); /**/ date gets stored as Wednesday,16 Mar 2022**
var name= **how do i add what the name of the country is thats been returned after the GMT+0200 so it would be Standard Time**
}
是否有一个格式选项可以将国家/地区名称分配给对象? 那么变量名将存储国家/地区?
I have the following where i am formatting the moment date and storing it into an object as follows
async date(){
var today=Moment() **// today gets stored as Wed Mar 16 2022 12:05:07 GMT+0200 (Standard Time)'**
var date= today.format("dddd,D MMM YYYY"); /**/ date gets stored as Wednesday,16 Mar 2022**
var name= **how do i add what the name of the country is thats been returned after the GMT+0200 so it would be Standard Time**
}
is there a format option that i can assign the Country name to an object?
so the variable name will store the country?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试这样获取国家/地区名称,
“猜测”将返回浏览器区域。
要获取浏览器区域以外的特定区域,
You can try like this to get the country name,
'guess' will return the browser zone.
To get particular zone other than browser zone,