It's defined somewhere but not using this string and I'm unaware of the API 
where it's defined natively. This is what we do for native date formatting 
(Objective-C code) in our native implementation:

#ifndef CN1_USE_ARC
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
#else
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
#endif
if (currentLocale != NULL) {
     formatter.locale = currentLocale;
} else {
     formatter.locale = cn1DeviceLocale();
}
NSDate* date = [NSDate dateWithTimeIntervalSince1970:(d / 1000)];
[formatter setDateStyle:NSDateFormatterMediumStyle];
JAVA_OBJECT o = fromNSString(CN1_THREAD_STATE_PASS_ARG [formatter 
stringFromDate:date]);
POOL_END();
return o;

On Sunday, August 23, 2020 at 1:31:37 PM UTC+3 P5music wrote:

> I do not need to format a date by a format string, I need the format 
> string itself, the current one, like the one it is now on your smartphone, 
> it is secrectly stored somewhere. If you change the date format on your 
> phone, another string is used. Android SDK lets me get it by a method call. 
> Is iOS so liberal too? Where I could find that method in iOS to call 
> natively from my app.
> Thanks
>
> Il giorno domenica 23 agosto 2020 alle 04:51:07 UTC+2 Shai Almog ha 
> scritto:
>
>> You use SimpleDateFormat with that string and it would write the name of 
>> the month instead of MMM in the short form. 
>> You construct a SimpleDateFormat with that string and then use the 
>> format(Date) method from that class.
>> On Saturday, August 22, 2020 at 11:04:21 AM UTC+3 P5music wrote:
>>
>>> I opened this SO question
>>>
>>> https://stackoverflow.com/questions/63492828/ios-getting-the-current-date-time-format-string
>>> but I couldn't include the CodenameOne tag.
>>> I wonder if there is a native function (or a workaround) to have the 
>>> current date-time format in iOS as a string like
>>>
>>> dd MMM y HH:mm:ss
>>>
>>> It's letters not the real values. I have to show it to the user.
>>>
>>> Thanks in advance
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/a435fc76-b380-4d0d-a056-9e9a8a777429n%40googlegroups.com.

Reply via email to