Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7833
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: split a number to Date format |
| Date | 2012-01-14 22:17 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jesut8$cmc$1@smc.vnet.net> (permalink) |
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: split a number to Date format Bill Rowe <readnews@sbcglobal.net> - 2012-01-14 22:17 +0000
csiph-web