Display users local zone abbreviation

后端 未结 5 1941
耶瑟儿~
耶瑟儿~ 2020-12-17 10:17

I was trying to use z or zz in format to display the timezone at the end of the string and found that it\'s deprecated. Z and ZZ

5条回答
  •  一个人的身影
    2020-12-17 10:35

    Probably this is not a good way, but I did not want to add any additional scripts in my project for local time zone, so I investigated a moment object and I get the local time zone by the code I wrote below:

     var test = momentUpdateDate._d.toString().substring(test.indexOf('(')+1, test.indexOf(')'));
    

提交回复
热议问题