timeIntervalSince1970 with Locale
I do not know how to get the timeIntervalSince1970 with the default Locale of the device.
I'm sorry but I think I can't understand what you try to accomplish.
Want you get the .timeIntervalSince1970 in device's locale? .timeIntervalSince1970 is the absolute number of seconds since 1970 and the value is not related to a specific locale.
If you want to get the .timeIntervalSince1970 from a DateInRegion object you can obtain it using
let secs = dateInRegionObj.absoluteDate.timeIntervalSince1970
I am using a third part library to represent my data on charts and I must provide the dates on the UNIXTimestamp format. Then, when I try to represent a date, it is shown as 2 hour before date because it is not taking the time with my current Locale.
You can allocate a Date object without using DateInRegion via:
.init(timeIntervalSince1970: TimeInterval)