From: Beata on

Dear MathGroup,

I have list of date
for example:
c={20100520,20100519,20100512,20100516,20100430,200100425,20100411,20100407}
in this format.
I need get from this list a new list with the same date but in absolutetime
When I use AbsoluteTime["20100520"], I get this, but I don't know how can
I use it for whole list c

Please for help
Beata

From: Patrick Scheibe on
Hi,

simply "Map" the desired function over your list

c = {20100520, 20100519, 20100512, 20100516, 20100430, 200100425,
20100411, 20100407};
out = AbsoluteTime[ToString[#]] & /@ c

Cheers,
Patrick


From: Hans Michel on
Beata:

You are correct that
AbsoluteTime["20100520"]
Works
In[1]:= AbsoluteTime["20100520"]
Out[1]= 3483302400

Your list c is a list of numbers. When you try the single value, you enclose
it in quotes.
Here are 2 list one is a list of strings d, c is your version.

d={"20100520","20100519","20100512","20100516","20100430","200100425","20100411","20100407"};
c={20100520,20100519,20100512,20100516,20100430,200100425,20100411,20100407};

In[3]:= Map[AbsoluteTime,d, 1]
Out[3]=
{3483302400,3483216000,3482611200,3482956800,3481574400,6314499548755200,3479932800,3479587200}

In[4]:= Map[AbsoluteTime,c, 1]
Out[4]=
{1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9,1.3359792985435000*10^9}

In[5]:= Map[AbsoluteTime, Map[ToString,c,1],1]
Out[5]=
{3483302400,3483216000,3482611200,3482956800,3481574400,6314499548755200,3479932800,3479587200}

If you wish to leave your list as a list of integers the see above.

Hans

So you need to
"Beata Warchol" <beatawarchol(a)gmail.com> wrote in message
news:ht5o84$14f$1(a)smc.vnet.net...
> Dear MathGroup,
>
> I have list of date
> for example:
> c={20100520,20100519,20100512,20100516,20100430,200100425,20100411,20100407}
> in this format.
> I need get from this list a new list with the same date but in
> absolutetime
> When I use AbsoluteTime["20100520"], I get this, but I don't know how can
> I
> use it for whole list c
>
> Please for help
> Beata
>
>


From: Bob Hanlon on

c = {20100520, 20100519, 20100512, 20100516, 20100430, 200100425,
20100411, 20100407};

AbsoluteTime /@ ToString /@ c

{3483302400,3483216000,3482611200,3482956800,3481574400,6314499548755200,3479932800,3479587200}


Bob Hanlon

---- Beata <beatawarchol(a)gmail.com> wrote:

=============

Dear MathGroup,

I have list of date
for example:
c={20100520,20100519,20100512,20100516,20100430,200100425,20100411,20100407}
in this format.
I need get from this list a new list with the same date but in absolutetime
When I use AbsoluteTime["20100520"], I get this, but I don't know how can
I use it for whole list c

Please for help
Beata



From: Hans Michel on
The dates needs to be in Mathematica Date Format as a List.

In[1]:= AbsoluteTime[{2010,05,20}]
Out[1]= 3483302400

Mathematica does not have a built in conversion of this string to a datetime
format "20100520"
In[2]:= DateString["20100520"]
Out[2]= 20100520

They should include it as it is a variation of ISO8601 without separators.

This format is commonly used in many EDI formats. So there is a need.

Hans

"Beata Warchol" <beatawarchol(a)gmail.com> wrote in message
news:ht5o84$14f$1(a)smc.vnet.net...
> Dear MathGroup,
>
> I have list of date
> for example:
> c={20100520,20100519,20100512,20100516,20100430,200100425,20100411,20100407}
> in this format.
> I need get from this list a new list with the same date but in
> absolutetime
> When I use AbsoluteTime["20100520"], I get this, but I don't know how can
> I
> use it for whole list c
>
> Please for help
> Beata
>
>