Skip to content

Berry: question on time formatting with f-strings #23323

Answered by sfromis
forumlw06 asked this question in Q&A
Discussion options

You must be logged in to vote

Don't expect "any expression" to get past the lexer within f-strings. While it can handle more than just simple variables, the colon will be problematic as it is also part of the syntax for the f-string.

One additional workaround could be to have the strftime pattern in a variable or function call.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@forumlw06
Comment options

Answer selected by forumlw06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants