commit d2324f6d835411f367bcb4104037437940bd9f12
parent 8fd3f5a4a89579774026f0f661c2e2ec6303537a
Author: St John Karp <contact@stjo.hn>
Date: Thu, 27 Aug 2020 08:34:20 -0500
GNU-Prolog: run today's date through the formatter
Make sure that today's date gets formatted properly.
Because GNU-Prolog doesn't have built-in predicates for this,
I've just directed it to use the format_date predicate which
uses the shell's date command.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dialects/gnu-prolog.pl b/dialects/gnu-prolog.pl
@@ -24,11 +24,12 @@ markdown_to_html(MarkdownEntryCodes, HTMLEntryCodes):-
% GNU-Prolog-specific handling of dates.
-today(DateCodes):-
+today(FormattedDateCodes):-
gnu_prolog,
date_time(dt(Year, Month, Day, Hour, Minute, Second)),
join([Year, '-', Month, '-', Day, ' ', Hour, ':', Minute, ':', Second], '', DateAtom),
- atom_codes(DateAtom, DateCodes).
+ atom_codes(DateAtom, DateCodes),
+ format_date(FormattedDateCodes, DateCodes).
% Format a date as RFC 822 (with a four-digit year).
format_date(FormattedDateCodes, DateCodes):-