Hi Jimmy, it was difficult to read the code due to email formatting. I
thought it would also be enjoyable to play around with printf
ts =: (6!:0) ''
frs ts
2018-01-26 17:49:50.537
'%d-%02d-%02d %02d:%02d:%f' printf <"0 ts
2018-01-26 17:49:50.537000
Or I suppose something like this even
frsJ =: 3 : 0
'yr M d h mi s'=.<@('0000' , ":)"0 y
;(_4{.yr);'-';(_2{.M);'-';(_2{.d);' ';(_2{.h);':';(_2{.mi);':';(_6{.s)
)
frsJ ts
2018-01-26 17:49:50.537
as you pointed out, it depends on what kind of code you want to maintain
On Fri, Jan 26, 2018 at 5:20 PM, Henry Rich <[email protected]> wrote:
> You put your finger on it in the last line of your post.
>
> Henry rich
>
>
> On 1/26/2018 5:16 PM, Jimmy Gauvin wrote:
>
>> Hi all,
>>
>> I was playing around with date/time formatting and ended up with :
>>
>> frs =: 3 : '''-- ::'' (4+3*i.5)}''0'' (I. y='' '') } y=.4 3 3 3 3 7j3
>> ":
>> y'
>>
>> I tried breaking it up into components to see if something would come out
>> of it :
>>
>> SE=: '-- ::' NB. Spacing Elements KS=: 4+3*i.5 NB. Koordinates of Spacing
>> elements FT=: 4 3 3 3 3 7j3 NB. Formatting Time elements BZ=: 3 : '''0''
>> (I. y='' '') } y' NB. Blanks to Zeroes
>> DTF=: 3 : 'SE KS} BZ FT ": y' NB. Date Time Format ]t=: 6!:0 '' 2018 1
>> 26 16 54 0.188 DTF t 2018-01-26 16:54:00.188
>>
>> I didn't get any new ideas but it got me thinking about programming style
>> and what kind of code I'd like to maintain.
>>
>>
>> All comments appreciated.
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm