首页 > 解决方案 > Ionic App -IOS 本地时间问题 - 但在 android 中工作正常

问题描述

我的离子应用程序有问题。我的应用程序是一个条形码扫描系统,最终会登录和退出。登录后显示登录时间,在 Android 中显示正确的本地时间,但在 iOS 中显示错误时间,相差 5 小时。我尝试了 UTC 时间转换以及日期格式,但仍然失败。

 private _formatedLocalTime(date: Date) {
    return (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours()  + ":" + date.getMinutes();
  }

标签: ionic-frameworkionic3

解决方案


推荐阅读