Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6738863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:25:08+00:00 2026-05-26T11:25:08+00:00

I am debugging a program in MacOSX, and I need that this program thinks

  • 0

I am debugging a program in MacOSX,
and I need that this program thinks we are one year later than the one given by the operating system.

I cannot change the time of the operation system, because I need to run a second program concurrently with the correct time.
I could modify the code of the first program to add one year each time it gets the time from the operation system, but the code is too big to do that; I prefer not to use this solution.

I heard once that there is a command in Unix to run a program with a fake/mocked time.
Do you know about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:25:08+00:00Added an answer on May 26, 2026 at 11:25 am

    I haven’t tried it, but libfaketime claims to do what you need.

    Quoted from the website:

    As an example, we want the “date” command to report our faked time. To do so, we could use the following command line:

    user@host> date
    Tue Nov 23 12:01:05 CEST 2007
    
    user@host> LD_PRELOAD=/usr/local/lib/libfaketime.so.1 FAKETIME="-15d" date
    Mon Nov  8 12:01:12 CEST 2007
    

    Assuming the lib works as advertised, you can trick your program into thinking it was running a year ahead using:

    LD_PRELOAD=/usr/local/lib/libfaketime.so.1 FAKETIME="+1y" ./your_program
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C/ncurses program that I'm debugging/maintaining. This program does ripoffline twice: first,
I am now debugging a program that utilizes many different threads. There is an
I want to use remote debugging. The program that I want to debug runs
I am debugging a VB 6.0 program that is using XML methods, etc. How
I am debugging a program that fails during a low memory situation and would
While debugging a program in Xcode I have several CFStringRef variables that point to
Is this possible? When I'm debugging a program I can't bring the window up
I am debugging a program that makes use of libnetfilter_queue . The documentation states
I'm programming something and I need debugging support on most operating systems (linux, windows,
When debugging a program using Visual Studio you are given the option to Enable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.