ionic-framework - Ionic App -IOS 本地时间问题 - 但在 android 中工作正常
问题描述
我的离子应用程序有问题。我的应用程序是一个条形码扫描系统,最终会登录和退出。登录后显示登录时间,在 Android 中显示正确的本地时间,但在 iOS 中显示错误时间,相差 5 小时。我尝试了 UTC 时间转换以及日期格式,但仍然失败。
private _formatedLocalTime(date: Date) {
return (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes();
}
解决方案
推荐阅读
- javascript - 请我希望在我的 javascript 数组上使用 reduce 方法
- php - PHP:在 WordPress 中点击链接时通过 AJAX 下载文件
- javascript - setInterval 用于运行 if 语句不起作用的函数
- r - 使用 dplyr 包中的 select + unlist 和使用美元符号有什么区别?
- lua - 动态类型语言的编译器如何处理非局部变量的变化?
- javascript - jQuery FadeIn() 等不起作用,浏览器认为它们根本不起作用
- python - 如果发生异常,删除 JSON 文件
- go - 如何锁定地图并修复数据竞争
- php - 在文件名旁边添加图标
- javascript - React-Native 动态改变 fetch url