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


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

Re: split a number to Date format

Started byUlrich Arndt <ulrich.arndt@data2knowledge.de>
First post2012-01-14 22:07 +0000
Last post2012-01-14 22:07 +0000
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: split a number to Date format Ulrich Arndt <ulrich.arndt@data2knowledge.de> - 2012-01-14 22:07 +0000

#7829 — Re: split a number to Date format

FromUlrich Arndt <ulrich.arndt@data2knowledge.de>
Date2012-01-14 22:07 +0000
SubjectRe: split a number to Date format
Message-ID<jesub2$cdd$1@smc.vnet.net>
This should do.

dn = Map[FromDigits[#, 10] &,
   Partition[IntegerDigits[111205020000, 10], 2]];
dn[[1]] += 2000;

DateString[dn]

Ulrich
Am 14.01.2012 um 08:54 schrieb Derek Martin:

> 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}.
>
> DateString[{2011, 12, 05, 02, 00, 00}] gives
> "Mon 5 Dec 2011 02:00:00"
>
> Any help to convert my number to the right Date format would be appreciated. I am using Mathematica 8.
>
> Thanks in Advance
> Derek
>

[toc] | [standalone]


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


csiph-web