Hello everybody,
According to:
https://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSDateFormatter.html
I should use a format with a % prefix.
If I understood the ref, I found several issues:
1) % is not interpreted as a prefix: it is displayed as a litteral.
2) If I use the symbols without prefix %, I obtain the expected
string, by example: 'd' provides dayOfTheMonth value.
3) b (for %b) should return abbreviated month name, but it returns
'PM' (like it is 'p' aka '%p')
Sample code:
- (NSString *) getInfo
{
// We declare an NSCalendarDate to retrieve the current date
NSCalendarDate *date = [NSCalendarDate calendarDate];
// We set a date format: expected: '25 mar.'
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat: @"d b"];
NSString *info = [dateFormat stringFromDate: date];
[dateFormat release];
NSLog(@"This is the current date: %@", info);
return info;
}
The output:
patrick@pi500:~/SOURCES/Birthday $ openapp ./Birthday.app
2026-03-25 13:48:31.956 Birthday[86925:86925] This is the current
date: 25 PM
Maybe I am misusing?
Best Regards,
Patrick
--
Patrick Cardona - Pi500 - GNU/Linux aarch64 (Debian 13.4)
Xorg (1:7.7+24) - libcairo2 (1.18.4-1+rpt1 arm64) - Window Maker
(0.96.0-4)
GWorkspace (1.1.0 - 02 2025) - Theme: AGNOSTEP - Classic - MUA:
GNUMail (1.4.0 - rev.947)