Hi Jeremy,

On 21 May 2012 16:47, Jeremy Traurig <jeremy.trau...@gmail.com> wrote:

> Is there a module available for python to convert datetime into an
>
I presume you mean, "convert a datetime *string* into an array of integers"?

array of integers. For example, I have date where the first column is
> a datetime string (i.e. '2010-10-10 01:10:00') and I would like to
> convert that into an array with 5 columns corresponding to the integer
> values of Year,Month,Day,Hour,Minute. There is a function in Matlab
>
Yes, Python datetime objects support that directly.  If d is a Python
datetime, then d.year gives you the year, d.month gives you the month
etc.   See here:  http://docs.python.org/library/datetime.html  Also see
8.1.7 regarding converting to and from datetime strings.

Walter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to