Wrong Date Format On IOS In Ionic5 Hybrid App ( Platform)

- 1 answer

I did not try that but I got it working now in xcode simulator. This function below works fine in Android but not in iPhone (Tracking-page):

const MyDate = new Date(timestamp + " UTC"); this.itemTimestamp = MyDate .toLocaleString();

In iPhone it gives INVALID DATE error.

I see the specification here:

But Appery says: "The Date type value is a string which contains a UTC timestamp stored in ISO 8601 format with millisecond precision: YYYY-MM-DDThh:mm:ss.mmm."( I don't know if this is the issue in the platform or in the code of mine.. So what is the correct format for that platform with or w/o "Z" at the end?



iOS supports the ISO format only, like '2022-02-10T21:26:11.119Z'

Z is the time zone offset specified as “Z” (for UTC) or either

More details you can find here:

So in the case, if you don't set the timezone the UTC will be selected automatically ("Z")

It is better to set the timezone every time to avoid issues with the wrong timezone