79586048

Date: 2025-04-22 09:04:41
Score: 0.5
Natty:
Report link

Use \z to control parsing of dates. Set to 0 for mm/dd/yyyy or 1 for dd/mm/yyyy.

https://code.kx.com/q/basics/syscmds/#z-date-parsing

q)date:`$("16/8/2022";"17/8/2022")
q)date
`16/8/2022`17/8/2022
q)\z 1
q)"D"$string date
2022.08.16 2022.08.17

The update query for your data:

q)\z 1 /Set to dd/mm/yyyy
q)update "D"$string Date from ydata
q)\z 0 /Reset back to default mm/dd/yyyy

More tips on parsing https://github.com/rianoc/parse_blog/blob/master/1.%20Parsing%20data%20in%20kdb%2B/parse.md#complex-parsing

Reasons:
  • Probably link only (1):
  • Contains signature (1):
  • Has code block (-0.5):
  • High reputation (-1):
Posted by: rianoc