BFP-I-389: Extend support for casting common strings into date objects

This idea is not mine. I have voted for it and added a comment.

BFP-I-389: Extend support for casting common strings into date objects

The date inspector should accept common formats as string input. While it’s great that the following is possible, converting an ISO-8601 date into a useful object should not require these histrionics:

q: date (( (tuple string item 2 of it) & " " & ((month it as string) of (tuple string item 1 of it as integer)) & " " & (tuple string item 0 of it) ) of (tuple strings of (substrings separated by "-" of it) of (preceding text of last "." of following text of first "_" of "foo_2025-05-20.bar"))) 
A: Tue, 20 May 2025 
T: 0.126 ms 
I: singular date
5 Likes

Postscript (which I will post into the idea):

Due an accident of choice, the above example only works with the integer 5, aka May. This is because the date <string> inspector requires the Month to be a three-character string.

  • month <integer> returns the month entire name.
  • date <string> requires the Month name to be three-characters (e.g. “Apr”)
  • month as three letters exists.

Ergo, the example above should have (month it as three letters).

That it is necessary to know the month as three letters cast exists is mind-numbingly ridiculous.

2 Likes