MathGroup Archive 2008

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

Search the Archive

Re: Difficulty in importing dates and times with functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94409] Re: [mg94380] Difficulty in importing dates and times with functions
  • From: Darren Glosemeyer <darreng at wolfram.com>
  • Date: Fri, 12 Dec 2008 06:54:47 -0500 (EST)
  • References: <200812110847.DAA01292@smc.vnet.net>

ADL wrote:
> Dear group, I have a difficulty in interpreting dates and times with
> functions like AbsoluteTime.
>
> When a date string is in the format that Mathematica understands
> automatically, the fractions of second are appropriately read:
>
> In:= AbsoluteTime["2008/12/01 12:34:56.454"]
> Out= 3.43712369645400000000000*10^9
>
> Instead, when the format has to be specifies, the fractions of second
> are ignored and I could not find a way to prevent this:
>
> In:= AbsoluteTime[{"2008-12-01 12.34.56.454",  {"Year", "Month",
> "Day", "Hour", "Minute", "Second"} }]
> Out= 3437123696
>
> This happens both in versions 6 and 7 for Windows. Does anyone know
> how to make this work ?
>
> Moreover, date importing functions appear to me very slow and very
> clumsy in their syntax. Does know anyone about something better which
> can be applied?
>
> Regards
>
> Al
>   

The value "Second" represents 2-digit seconds. To get the trailing 
digits as well, use "SecondExact"

In[1]:= AbsoluteTime[{"2008-12-01 12.34.56.454", {"Year", "Month", "Day",
           "Hour", "Minute", "SecondExact"}}]

                                    9
Out[1]= 3.43712369645400000000000 10


There is a list of possible date/time elements and short descriptions of 
them in the More Information section of the documentation for DateString 
in product or at the following:

http://reference.wolfram.com/mathematica/ref/DateString.html


Darren Glosemeyer
Wolfram Research


  • Prev by Date: Re: Clever way to manipulate lists
  • Next by Date: Re: how to get around bug
  • Previous by thread: Re: Difficulty in importing dates and times with functions
  • Next by thread: Re: Difficulty in importing dates and times with functions like