使用VUEJS将UNIX TIMESTAMP转换为迄今
我正在AEM担任云服务。在此,使用查询构建器,我将获得JCR:通过Servlet创建页面的日期。为了打电话,我正在使用VUE JS。现在,servlet返回的日期为unix格式。我想使用vuejs将其转换为日期格式。
I am working in AEM as a Cloud Service. In that, using query builder I'm getting jcr:created date of the pages through Servlet. To call that servlet, I'm using Vue JS. Now, the date returned by the servlet is in UNIX format. I want to convert that into date format using VueJS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下语句:
UNIX时间戳为秒,而
date()
期望毫秒 - 因此,我们只是乘以1000。请记住,结果日期将在您的本地时区 - 不在您的本地时区 - 不在服务器/数据库。Use the following statement:
UNIX timestamps are in seconds while
Date()
expects milliseconds - so we just multiply by 1000. Keep in mind that the resulting date will be in your local timezone - not in the timezone of the server/database.