%Z stands for time zone name in letters Eg. IST or EDT or GMT, so it would
fail to parse +05:30

However I do not have a solution to your problem but a footnote as hint -
http://docs.python.org/library/time.html#id1

-- Abhishek

On Tue, May 4, 2010 at 3:17 PM, vishwajeet singh <dextrou...@gmail.com>wrote:

> Dear All,
>
> I am trying to convert date string to datetime using datetime.strptime and
> when there is timezone part in string conversion is throwing errors.
>
> Here is what I am doing
> string_date = somedate.strftime("%a, %d %b %Y %H:%M:%S %Z")
>
> and than later in some other part of code
> actual_date = datetime.strptime(string_date,"%a, %d %b %Y %H:%M:%S %Z")
>
> I am getting following error for this conversion "*time data 'Tue, 04 May
> 2010 14:59:45 +05:30' does not match format '%a, %d %b %Y %H:%M:%S %Z'*"
>
>  All formats without timezone works perfectly fine.
>
> --
> Vishwajeet Singh
> +91-9657702154 | dextrou...@gmail.com | http://bootstraptoday.com
> Twitter: http://twitter.com/vishwajeets | LinkedIn:
> http://www.linkedin.com/in/singhvishwajeet
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to