Skip to main content

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Jorge Grajeda
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Jorge Grajeda
    Python Development Techdegree Graduate 8,189 Points

    dt.py task 3 of 4

    Posted February 14, 2023 7:22pm by Jorge Grajeda
    .a{fill-rule:evenodd;}techdegree seal-36
    Jorge Grajeda
    Python Development Techdegree Graduate 8,189 Points
    • Python
    • Dates and Times in Python (2014)
    • Dates and Times
    • now() and .replace()

    1 Answer

  • Tafadzwa Timothy Gakaka
    Tafadzwa Timothy Gakaka
    10,978 Points

    dates and time in python

    Posted December 16, 2020 5:40pm by Tafadzwa Timothy Gakaka
    Tafadzwa Timothy Gakaka
    10,978 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    3 Answers

  • Emily Strobl
    Emily Strobl
    5,429 Points

    im a little confused on how to use the replace method

    Posted September 9, 2019 4:45pm by Emily Strobl
    Emily Strobl
    5,429 Points
    • Python
    • Dates and Times in Python (2014)
    • Dates and Times
    • now() and .replace()

    2 Answers

  • Millie Jack
    Millie Jack
    278 Points

    agin help task 3

    Posted March 16, 2018 8:27pm by Millie Jack
    Millie Jack
    278 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • Millie Jack
    Millie Jack
    278 Points

    duunoo what to do

    Posted March 16, 2018 8:23pm by Millie Jack
    Millie Jack
    278 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • Bar Kamhine
    Bar Kamhine
    434 Points

    What is the problem?

    Posted October 17, 2017 12:45am by Bar Kamhine
    Bar Kamhine
    434 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • Chris van Beem
    PLUS
    Chris van Beem
    Courses Plus Student 26,647 Points

    import datetime now = datetime.datetime.now() two = now.replace(hours, 14) TASK 1 NO LONGER PASSING?

    Posted January 30, 2017 1:46pm by Chris van Beem
    Chris van Beem
    Courses Plus Student 26,647 Points
    • Python
    • Dates and Times in Python (2014)
    • Dates and Times
    • now() and .replace()

    1 Answer

  • FHATUWANI Dondry MUVHANGO
    FHATUWANI Dondry MUVHANGO
    17,796 Points

    help with datetime

    Posted November 10, 2016 7:59pm by FHATUWANI Dondry MUVHANGO
    FHATUWANI Dondry MUVHANGO
    17,796 Points
    • Python
    • Dates and Times in Python (2014)
    • Dates and Times
    • now() and .replace()

    2 Answers

  • gregory fenwick
    gregory fenwick
    7,569 Points

    AttributeError: type object 'datetime.datetime' has no attribute.

    Posted May 27, 2016 12:48am by gregory fenwick
    gregory fenwick
    7,569 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • MUZ140348 Sympathy Makururu
    MUZ140348 Sympathy Makururu
    10,209 Points

    Challenge Task 2 of 4 Create a variable named now that holds the results of datetime.datetime.now().

    Posted July 3, 2015 1:27pm by MUZ140348 Sympathy Makururu
    MUZ140348 Sympathy Makururu
    10,209 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    3 Answers

  • MUZ141065 Diana Shone
    MUZ141065 Diana Shone
    2,978 Points

    finally change two so its minute is 30

    Posted July 3, 2015 12:14pm by MUZ141065 Diana Shone
    MUZ141065 Diana Shone
    2,978 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    2 Answers

  • Liana Moleni
    Liana Moleni
    2,644 Points

    two's minute is 49, should be 30

    Posted May 25, 2015 11:51pm by Liana Moleni
    Liana Moleni
    2,644 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • Gordon Reeder
    Gordon Reeder
    2,521 Points

    Can't replace minute

    Posted April 8, 2015 10:08pm by Gordon Reeder
    Gordon Reeder
    2,521 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    1 Answer

  • MUZ140057 Dumisani Nyamusa
    MUZ140057 Dumisani Nyamusa
    8,029 Points

    date and times

    Posted January 22, 2015 1:19pm by MUZ140057 Dumisani Nyamusa
    MUZ140057 Dumisani Nyamusa
    8,029 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    3 Answers

  • Ben Thomas
    Ben Thomas
    1,911 Points

    Challenge Code Works Returns Correct Answer in IDLE Shell, But Not on Website

    Posted December 1, 2014 11:40pm by Ben Thomas
    Ben Thomas
    1,911 Points
    • Python
    • Dates and Times in Python
    • Dates and Times
    • now() and .replace()

    3 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord