src/sompiler/fb.bi:
const FB_BUILD_DATE = __DATE__
This is ambiguous. None but Americans use the date format MM/DD/YY.
Replace with
const FB_BUILD_DATE = __DATE_ISO__
and everyone should be happy.
Replace __DATE__ with __DATE_ISO:__
Re: Replace __DATE__ with __DATE_ISO:__
Fb originated from vbdos, the quickbasic family, i.e. Microsoft.
So I suppose fb is naturally American, although the author (V1ctor) would use D/M/Y at his location.
https://en.wikipedia.org/wiki/Date_format_by_country
But it can be adjusted for another location:
So I suppose fb is naturally American, although the author (V1ctor) would use D/M/Y at his location.
https://en.wikipedia.org/wiki/Date_format_by_country
But it can be adjusted for another location:
Code: Select all
#include "vbcompat.bi"
#define ISODATE format(now,"dd/mm/yyyy")
print isodate
sleep
Re: Replace __DATE__ with __DATE_ISO:__
I'd also use a date in ISO 8601 format (which is YYYY-MM-DD) rather than any localized version, but it's a breaking change if we do so.skogtun wrote:src/sompiler/fb.bi:
const FB_BUILD_DATE = __DATE__
This is ambiguous. None but Americans use the date format MM/DD/YY.
Anyway, the documentation mentions even a different format (dd-mm-yyyy) for that constant:
http://freebasic.net/wiki/wikka.php?wak ... BBuildDate
So is the documentation wrong. If so the breaking change would be even less important, because it could be rather considered as a fix.
Re: Replace __DATE__ with __DATE_ISO:__
No, the documentation specifies the correct format of the returned date: MM-DD-YYYYSt_W wrote:Anyway, the documentation mentions even a different format (dd-mm-yyyy) for that constant:
http://freebasic.net/wiki/wikka.php?wak ... BBuildDate
Re: Replace __DATE__ with __DATE_ISO:__
Sorry, I got the wrong end of the stick.
I am on NOW, not then.
I am on NOW, not then.
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Replace __DATE__ with __DATE_ISO:__
Using a macro would allow a renaming on demand without any breach on the backward compatibility:
Maybe of course I miss the crucial point.
Code: Select all
#undef __DATE_ISO__
#macro __DATE_ISO__
str(__DATE__)
#endmacro
? __DATE_ISO__