SplitDate

Transform an array of integer scalars representing YYYYMMDD into an array of 1 higher rank with three columns representing YYY MM DD.

      ⍉0 100 100⊤ISV

Examples

      0 100 100⊤⍉20100102 
2010 1 2
      ⍉0 100 100⊤⍉20100102 19991231
2010  1  2
1999 12 31
      ⍉0 100 100⊤⍉2 2⍴20100102 19991231 30000101 30001231
2010  1  2
1999 12 31
          
3000  1  1
3000 12 31

The initial transpose on the right, which is redundant for scalar or vector IA, ensures that all other dimensions return to the correct order after the second transpose with the new first dimension moved to the last position.

Compatibility

Checked with: APL2, APLX, Dyalog, NARS2000

See also: JoinDate

Mentor: KaiJaeger

Tags: <TransformDate> <IntAsDate>


CategoryPhrasesAll - CategoryPhraseDates

PhraseBook/SplitDate (last edited 2016-03-26 16:26:09 by KaiJaeger)