MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Date & Time format..

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107717] Re: Date & Time format..
  • From: graser <graser at gmail.com>
  • Date: Wed, 24 Feb 2010 06:20:30 -0500 (EST)
  • References: <hlj414$rqp$1@smc.vnet.net>

On Feb 18, 5:16 am, Bill Rowe <readn... at sbcglobal.net> wrote:
> On 2/17/10 at 7:01 AM, gra... at gmail.com (graser) wrote:
>
> >I have a list of date and time string such as..
> >AA = {"Start", "Time", "11/4/2009", "3:24:06.505", "PM"}
> >I want to read "11/4/2009", "3:24:06.505", "PM" as date format..
> >so I did
> >DateList["11/4/2009 3:24:06.505 PM"] and actually it gives me as
> >{2009, 11, 4, 15, 24, 6.505}
> >But there is also waring message like..
> >** DateList::ambig: Warning: the interpretation of the string
> >11/4/2009 3:24:06.505 PM as a date is ambiguous. >> ***
> >So I thought the problem was "PM"
>
> That is not the issue. The uncertainty is whether the "11/4"
> portion of the string is a month followed by a day or a day
> followed by a month.
>
> >I tried it again with
> >DateList[{"11/4/2009 3:24:06.505 PM", {"Day", "Month", "Year",
> >"Hour", "Minute", "Second", "AMPM"}}]
> >But it didn't work...
>
> This doesn't work because what you told Mathematica to expect
> doesn't match the format of the string. This works
>
> In[9]:= DateList[{"11/4/2009 3:24:06.505 PM", {"Day", "Month", "Year",
>      "Hour", "Minute", "Second", "Millisecond", "AMPM"}}]
>
> Out[9]= {2009,4,11,3,24,6.505}
>
> and this works
>
> In[10]:= DateList[{"11/4/2009 3:24:06 PM", {"Day", "Month", "Year",
>     "Hour", "Minute", "Second", "AMPM"}}]
>
> Out[10]= {2009,4,11,3,24,6}

Hello,

Thanks for your reply...

But my question was

1. how to make Mathematica recognize AMPM situation

It is not working with your methods

2. Yes.. how to clear the ambiguity..
either day/month or month/day...


  • Prev by Date: Re: Re: Handheld mathematica
  • Next by Date: Re: Handheld mathematica
  • Previous by thread: Re: Date & Time format..
  • Next by thread: Re: Date & Time format..