question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad date format under certain condition

See original GitHub issue

Some weird conversion when format string contains single character, like

>>> sql
'SELECT TO_DATE(boo, "d-M-yyyy HH:mm:ss")'
>>> sqlglot.parse(sql, read='spark')
[(SELECT expressions:
  (TSORDSTODATE this:
    (COLUMN this:
      (IDENTIFIER this: boo, quoted: False)), format:
    (LITERAL this: %-d-%-m-%Y %H:%M:%S, is_string: True)))]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tobymaocommented, Aug 26, 2022

fixes in v5.1.2

0reactions
samjsharpecommented, Aug 26, 2022

Oh wow, thank you very much @tobymao !

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Ways to Fix Dates Formatted as Text in Excel
Step 3 of the Wizard: Choose 'Date' from the 'Column Data Format' options and choose your date format from the drop down list...
Read more >
conditional formatting when wrong date format entered
Hello, I am working on a spreadsheet that records training records. the order of rules is as follows 1) If the cell is...
Read more >
Excel conditional formatting for dates & time: formulas and rules
Excel conditional formatting for dates (built-in rules). Microsoft Excel provides 10 options to format selected cells based on the current date.
Read more >
PHP Wrong Date Format When Using Under Condition
Problem is here: $date='' , In your conditional statement you are not just checking you are initializing a value that's why it will...
Read more >
Error: Bad date format string - when previewing a Crystal Report
Usually the bad format error is generated when a formula is trying to convert a string type into a date type field but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found