We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The DatePrinter.from_fsrting function appears to work correctly with all possible formats.
DatePrinter.from_fsrting
utop # CalendarLib.Printer.DatePrinter.from_fstring "%Y-%m-%d %H:%M%z" "1970-01-01 00:00+0000" |> CalendarLib.Printer.DatePrinter.sprint "%d/%m/%Y" ;; - : string = "01/01/1970"
If you want to handle both date and time, however... The CalendarPrinter.from_fstring function fails with a generic exception for most formats.
CalendarPrinter.from_fstring
utop # CalendarLib.Printer.CalendarPrinter.from_fstring "%Y-%m-%d %H:%M%z" "1970-01-01 00:00+0000" |> CalendarLib.Printer.CalendarPrinter.sprint "%d/%m/%Y" ;; Exception: Invalid_argument "Cannot create the calendar".
It only seems to works for shortcut format specifiers that include both date and time, like %c.
%c
utop # CalendarLib.Printer.CalendarPrinter.from_fstring "%c" "Thu Sep 18 14:10:51 2003" |> CalendarLib.Printer.CalendarPrinter.sprint "%d/%m/%Y" ;; - : string = "18/09/2003"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
DatePrinter.from_fsrting
function appears to work correctly with all possible formats.If you want to handle both date and time, however... The
CalendarPrinter.from_fstring
function fails with a generic exception for most formats.It only seems to works for shortcut format specifiers that include both date and time, like
%c
.The text was updated successfully, but these errors were encountered: