---
title: "DateTime.LastYear"
url: "https://osherove.com/blog/2009/5/22/datetimelastyear.md"
canonical: "https://osherove.com/blog/2009/5/22/datetimelastyear.html"
published: "2009-05-22T02:09:21"
updated: "2009-05-22T02:09:21"
tags: ["Agile", "Unit Testing"]
author: "Roy Osherove"
description: "Oh, didn’t I mention we can now fake DateTime.Now in unit tests ?"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# DateTime.LastYear

By Roy Osherove May 22, 2009 In [Agile](https://osherove.com/blog/category/agile), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published May 22, 2009; technical details may be outdated.

Oh, didn’t I mention we can now [fake DateTime.Now in unit tests](http://blog.typemock.com/2009/05/mockingfaking-datetimenow-in-unit-tests.html)?

## More in Agile

[All posts in Agile](https://osherove.com/blog/category/agile)

- May 23, 2009

    ### [SilverUnit Project Template and new version](https://osherove.com/blog/2009/5/23/silverunit-project-template-and-new-version.html)

- May 23, 2009

    ### [Testing that an event was raised](https://osherove.com/blog/2009/5/23/testing-that-an-event-was-raised.html)

- May 20, 2009

    ### [Art Of Unit Testing (The Samurai Book)– Get it now, it’s done.](https://osherove.com/blog/2009/5/20/art-of-unit-testing-the-samurai-book-get-it-now-its-done.html)

- May 19, 2009

    ### [Introducing Typemock Racer 1.0 – Find multithreaded deadlocks](https://osherove.com/blog/2009/5/19/introducing-typemock-racer-10-find-multithreaded-deadlocks.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
