Hi, Group!
I'd like to be able to change this:
┌──────────┬──────────┬──────────┐
│4-Apr-1930│5-Apr-1930│6-Apr-1930│
└──────────┴──────────┴──────────┘
into this:
┌──────────┬──────────┬──────────┐
│1930-04-04│1930-04-05│1930-04-06│
└──────────┴──────────┴──────────┘
Although I've been using J for 10 years at a rather elementary level
(at least in terms of understanding what I'm doing, although the
applications may not be elementary at all), I occasionally run into
something that I just cannot figure out, even after lots of trial and
error. (I'm not at all interested in tacit J, so in your help please
limit yourself to explicit J.)
Here is what I've come up with so far. (There's a reason I wanted 12
values--you'll see in a minute.)
aa0=. '4-Apr-1930';'5-Apr-1930';'6-Apr-1930' NB. example setup
aa1=. aa0,aa0,aa0,aa0
a0=. isotimestamp getdate every aa1
]d0=. 10 {. a0
1930-04-04 00:00:00.000
1930-04-05 00:00:00.000
1930-04-06 00:00:00.000
1930-04-04 00:00:00.000
1930-04-05 00:00:00.000
1930-04-06 00:00:00.000
1930-04-04 00:00:00.000
1930-04-05 00:00:00.000
1930-04-06 00:00:00.000
1930-04-04 00:00:00.000
I thought that 10 {. a0 would retrieve the first 10 characters of
each timestamp (that is, omitting the time element). However, it
retrieved the first 10 timestamps instead. I tried all sorts of
things I could think of, but, as I said, nothing has worked.
Please help! I would prefer at least two steps--one which grabs just
the yyyy-mm-dd values (not the time values) and one which boxes those
reformatted dates as shown above.
Thanks in advance!
Harvey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm