Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7833 > unrolled thread

Re: split a number to Date format

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-01-14 22:17 +0000
Last post2012-01-14 22:17 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: split a number to Date format Bill Rowe <readnews@sbcglobal.net> - 2012-01-14 22:17 +0000

#7833 — Re: split a number to Date format

FromBill Rowe <readnews@sbcglobal.net>
Date2012-01-14 22:17 +0000
SubjectRe: split a number to Date format
Message-ID<jesut8$cmc$1@smc.vnet.net>
On 1/14/12 at 2:54 AM, cdmartin@me.com (Derek Martin) wrote:

>I have experimental data in spreadsheet format.  The first column is
>a time stamp in the format 111205020000. If I could parse or split
>the number 111205020000 into {11,12,05,02,00,00} and replace the
>first 11 with 2011, the Date commands would work fine. I can do the
>replacing, but am having difficulty seeing how to split the number
>into  {11,12,05,02,00,00}.

In[16]:= IntegerDigits[111205020000, 100] /. {a_, b__} :> {2000
+ a, b}

Out[16]= {2011,12,5,2,0,0}

In[17]:= DateString[%]

Out[17]= Mon 5 Dec 2011 02:00:00

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web