如何在Couchdb查看图中的当地时间或时区格式或获得日期减少?
我在couchdb中有一个数据库,该数据库是一个字段类型的日期时间,但是当我在查看(地图)中显示数据时,数据显示以ISO格式显示。我想在LocalTime中显示如何格式化?我尝试了两个函数,但不使用JavaScript函数tostring()或TolocalString()不起作用
I have a database in couchDB, a field type datetime, but when i show in view (map) the data show in format ISO. I want to show in localtime, how to format? i tried with two function but not work with javascript function toString() or toLocalString() not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在搜索和搜索后发布了对我有用的答案,我为您提供了一个完整的示例地图中的视图,以及如何将日期从标准格式转换为本地格式。在这种情况下,我使用-6是中美洲时区。
将VAR DateTime从字段DateTime
更改为UTC-6。
如果将Time-4更改为UTC-4,
我 ()要转换为字符串,它将显示在您在服务器上配置的区域 /时间中显示,然后这是一件要分开的事情,并且完成了。
我希望它对您有用并为您提供帮助。
I publish the answer that worked for me after searching and searching, I leave you a complete example of the view in map reduce and how I convert the date from standard format to local format. In this case I use -6 which is the Central American time zone.
I declare var datetime from field datetime
change time-zone to UTC-6
if change time-zone to UTC-4
So I managed to change the format of the date for the view in couchdb, you can use the javascript functions toLocalString() toString() to convert to a string, it will be displayed in the zone / time that you have configured on the server, then it is a thing to do split and you're done.
I hope it works for you and helps you.