Hacker GitHub

← All repos

wolfcw/libfaketime

View on GitHub ↗ ★ 3,127 C

libfaketime modifies the system time for a single application

14 mentions on Hacker News by 14 people: 2 stories, 12 comments · first 2013-02-20 · latest 2026-01-16

Mentions per year 14 mentions · busiest year 2019 (3)
20082026
  1. …of things. It intercepts system calls to get the time and reports a fake time to the application. https://github.com/wolfcw/libfaketime
    comment by jcul · 2025-05-12 · in The Epochalypse Project
  2. …the real program and speed up time to make sure it doesn't try to download more than once. [0] https://github.com/wolfcw/libfaketime
    comment by doix · 2025-04-29 · in A single line of code cost $8000
  3. The easiest way to do this (in my experience) is libfaketime. I'm surprised not to see it mentioned. https://github.com/wolfcw/libfaketime
    comment by ForkMeOnTinder · 2023-12-20 · in How to unit test code that depends on time
  4. …regarding this topic. It can bei used to change the system time for a single application only. https://github.com/wolfcw/libfaketime
  5. …in the interest of getting things done on schedule I’d suggest running tests in a container with https://github.com/wolfcw/libfaketime and orchestrating edge cases like leap seconds external to the test suite itself.
    comment by devonkim · 2020-05-25 · in Mocking time and testing event loops in Go
  6. One way is to override the libc time functions using LD_PRELOAD using something like https://github.com/wolfcw/libfaketime This doesn't work with everything (for example doesn't work with Go because Go doesn't use libc for such things) but…
    comment by donio · 2019-07-13 · in Add-Ons Outage Post-Mortem Result
  7. You don’t have to write that code yourself, you can just use libfaketime https://github.com/wolfcw/libfaketime
  8. There's a well-known libfaketime library, that can forge the current system time. https://github.com/wolfcw/libfaketime Here's my friend's LD_PRELOAD hack, it pushes the idea further: hooking gettimeofday() to make a program to think that…
    comment by segfaultbuserr · 2019-02-18 · in LD_PRELOAD: The Hero We Need and Deserve
  9. Interesting projects that employ LD_PRELOAD: https://github.com/stewartsmith/libeatmydata https://github.com/wolfcw/libfaketime https://cwrap.org/ https://github.com/dex4er/fakechroot https://blitiri.com.ar/p/libfiu/…
  10. …calls. Nothing against the current project but that might be a better choice for many people. [1] - https://github.com/wolfcw/libfaketime
  11. You can use `libfaketime` to test your software: * https://github.com/wolfcw/libfaketime Shameless plug: my project `fluxcapacitor` may also be useful for testing: * https://github.com/majek/fluxcapacitor
    comment by majke · 2013-05-02 · in Year 2038 problem
  12. See also libfaketime, which does all this and more besides: https://github.com/wolfcw/libfaketime