Updates
There is an easier way to do this, Matt Schinckel suggested to use this piece of code:

from datetime import datetime

datetime.strptime(STRING_TO_BE_CONVERTED, TIME_FORMAT_OF_THE_STRING)

Post filed under Python and tagged , , , , , , .

70 Comments

  1. Or:

    datetime.strptime(string, format_string)

    • I tried that and it didn’t work. I’ll try to reproduce the error tomorrow and put the detail here.

    • Apparently, I didn’t notice correctly the difference between your code and mine and just noticed that you use datetime.strptime while I foolishly use time.strptime. I tried your code on my work and it works like a charm. Using time.strptime alone was the problem that caused error on my case earlier, I didn’t know that datetime also has strptime. Thanks for your correction Matt.

  2. Wonderful items from you, man. I’ve remember your stuff previous to and you are simply too great. I actually like what you’ve acquired right here, certainly like what you are saying and the best way in which you assert it. You’re making it enjoyable and you continue to take care of to stay it smart. I can not wait to read far more from you. That is actually a terrific web site.

  3. I don’t typically comment but I gotta state thanks for the post on this fantastic 1 : D.
    84HLUL3NT3
    vimax funciona
    vimax
    vimax brasil
    comprar vimax

  4. thanks.very good blog and very good share.

  5. After reading your blog post I browsed your website a bit and noticed you aren’t ranking nearly as well in Google as you could be. I possess a handful of blogs myself and I think you should take a look here: http://dominateseowithwordpress.com You’ll find it’s a very nice tool that can bring you a lot more visitors. Keep up the quality posts

  6. I have to say that for the last few of hours i have been hooked by the impressive posts on this blog. Keep up the great work.

  7. Well I really enjoyed studying it. This tip procured by you is very useful for correct planning.

  8. If you’re serious about making money with your website, watch this free video about getting free instant targeted traffic to your site http://instanttrafficrobot2.com

  9. I was strucked as I read this blog. I think the blogger got so much idea about this post, think he/she really had long days studying this matter or he/she is just really a skillful writer. Thank you and good work!

  10. After reading your blog post I browsed your website a bit and noticed you aren’t ranking nearly as well in Google as you could be. I possess a handful of blogs myself and I think you should take a look here: http://seopressors.org You’ll find it’s a very nice tool that can bring you a lot more visitors. Keep up the quality posts

  11. That insight’s just what I’ve been lokonig for. Thanks!

  12. Hello there, just became alert to your blog via Google, and discovered that it?s truly informative. I?m gonna watch out for brussels. I?ll be grateful in the event you continue this in future. Numerous individuals will probably be benefited from your writing. Cheers! 370952

  13. I’m usually to running a blog and i actually appreciate your content. The article has really peaks my interest. I’m going to bookmark your site and keep checking for new information.

  14. This specific really responded to my own issue, thanks!

  15. Your house is valueble for me. Thanks!…

  16. Hi,Watch This FREE Video How To Build Over 100,000 backlinks and drove over 500,000 targeted visitors from free traffic source to your sites http://rankbuilder2.net/ Get Google Top Spot Now

  17. If you want to get social bookmarking backlinks that will help skyrocket your website search engine ranking straight to the top, check out this site http://socialbookmarksubmission.org/

  18. Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! However, how can we communicate?

  19. Just want to say your article is as astounding. The clarity in your post is just great and i could assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please carry on the gratifying work.

  20. You are a very bright individual!

  21. There is noticeably a bunch to know about this. I feel you made certain good points in features also.

  22. You are a very capable person!

  23. Wow! Thank you! I continuously needed to write on my website something like that. Can I include a fragment of your post to my website?

  24. I think this is one of the most vital information for me. And i’m glad reading your article. But want to remark on few general things, The web site style is great, the articles is really excellent : D. Good job, cheers

  25. Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you helped me.

  26. Hello.This post was extremely interesting, especially since I was investigating for thoughts on this issue last couple of days.

  27. Great post. I was checking constantly this blog and I am impressed! Very helpful information specially the last part :) I care for such info a lot. I was looking for this certain info for a long time. Thank you and good luck.

  28. Keep working ,terrific job!

  29. Keep functioning ,impressive job!

  30. Excellent blog here! Also your website loads up fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol

  31. Of course, what a magnificent blog and revealing posts, I will bookmark your blog.All the Best!

  32. I am constantly browsing online for posts that can assist me. Thank you!

  33. Very nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!

  34. I’m still learning from you, while I’m trying to reach my goals. I certainly enjoy reading everything that is posted on your blog.Keep the posts coming. I loved it!

  35. Fantastic beat ! I would like to apprentice while you amend your site, how could i subscribe for a blog website? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concept

  36. Magnificent beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog site? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

  37. Hello.This article was extremely remarkable, particularly because I was investigating for thoughts on this matter last Saturday.

  38. I have been checking out some of your posts and it’s pretty nice stuff. I will make sure to bookmark your website.

  39. You made several good points there. I did a search on the topic and found most people will agree with your blog.

  40. Awsome info and straight to the point. I don’t know if this is in fact the best place to ask but do you folks have any thoughts on where to employ some professional writers? Thanks in advance :)

  41. You actually make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complex and extremely broad for me. I am looking forward for your next post, I’ll try to get the hang of it!

  42. I’m extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the excellent quality writing, it is rare to see a great blog like this one today..

  43. You completed some fine points there. I did a search on the issue and found nearly all persons will agree with your blog.

  44. Keep working ,splendid job!

  45. You are a very bright individual!

  46. Great post. I was checking continuously this blog and I’m impressed! Very helpful information particularly the last part :) I care for such information much. I was seeking this particular info for a very long time. Thank you and best of luck.

  47. Super-Duper site! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also

  48. Pretty nice post. I just stumbled upon your weblog and wished to say that I have really enjoyed surfing around your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

  49. Thanks for the good writeup. It if truth be told used to be a enjoyment account it. Glance complex to more added agreeable from you! By the way, how can we keep up a correspondence?

  50. Wow, awesome blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is excellent, as well as the content!

  51. Very nice info and straight to the point. I don’t know if this is truly the best place to ask but do you people have any thoughts on where to employ some professional writers? Thanks :)

  52. Hello there, You’ve done a great job. I will definitely digg it and personally recommend to my friends. I am sure they’ll be benefited from this web site.

  53. Fantastic beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog web site? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

  54. I have been checking out many of your articles and i can claim pretty clever stuff. I will definitely bookmark your site.

  55. Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and aid others like you helped me.

  56. Excellent blog here! Also your website loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my site loaded up as quickly as yours lol

  57. Very well written post. It will be beneficial to everyone who usess it, as well as me. Keep doing what you are doing – can’r wait to read more posts.

  58. As a Newbie, I am continuously searching online for articles that can benefit me. Thank you

  59. I simply wanted to compose a brief message in order to appreciate you for all the great advice you are placing here. My time-consuming internet search has at the end of the day been honored with good ideas to exchange with my visitors. I ‘d claim that most of us readers actually are quite endowed to exist in a very good network with very many perfect professionals with insightful secrets. I feel very grateful to have discovered your entire website page and look forward to many more fun times reading here. Thanks once more for all the details.

  60. Wow! Thank you! I constantly wanted to write on my website something like that. Can I take a fragment of your post to my blog?

  61. Keep functioning ,fantastic job!

  62. Hello, i think that i saw you visited my website thus i came to “return the favor”.I am attempting to find things to enhance my site!I suppose its ok to use a few of your ideas!!

  63. My brother recommended I might like this web site. He was totally right. This post truly made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  64. Well I really enjoyed studying it. This information provided by you is very effective for accurate planning.

  65. Wow! Thank you! I always wanted to write on my website something like that. Can I take a part of your post to my website?

  66. babyliss miracurl says:

    Precisely why do this many people state Jango just isn’t talked about in the responds? There are numerous response that refer to Jango. It can be probably the most referenced site in most in the responses.

  67. Excellent weblog you could have right here although I had been questioning in the event you realized involving almost any forums that cover exactly the same topics talked about in this article? I’d really like to become a part of team everywhere I can receive thoughts from their experienced people who show the identical curiosity. In case you have any kind of strategies, make sure you allow know. Many thanks!
    ugg classic tall chestnut sale http://www.kintuperu.com/ugg-outlet-sale/ugg-classic-tall-chestnut-sale.html

  68. Hmm is anyone else encountering problems with the pictures on this blog loading?
    I’m trying to determine if its a problem on my end or if it’s
    the blog. Any suggestions would be greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>