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

  • Home
  • SEARCH
  • 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 983223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:49:19+00:00 2026-05-16T04:49:19+00:00

Taking user input such as tomorrow, in three days, 3 months 30 days, march

  • 0

Taking user input such as “tomorrow”, “in three days”, “3 months 30 days”, “march 30, 2011” and interpreting it into a timestamp usable by php.

I feel like I’ve seen something like this before in a task management system. I’d like to use it for something a little different but I can’t find anything precooked anywhere. Maybe I saw it on Remember the Milk? (It’s down as I’m writing this)

Does anyone know of something like this? (preferably php)

  • 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-16T04:49:19+00:00Added an answer on May 16, 2026 at 4:49 am

    Take a look at strtotime:

    <?php
    $now = time();
    printf("%20s : %s\n", 'now', date('Y-m-d H:i:s', $now));
    
    foreach( array("tomorrow", "+ 3 days","3 months 30 days","march 30, 2011") as $userinput ) {
      $ts = strtotime($userinput, $now);
      printf("%20s : %s\n", $userinput, date('Y-m-d H:i:s', $ts));
    }
    

    prints

                 now : 2010-08-08 09:44:49
            tomorrow : 2010-08-09 00:00:00
            + 3 days : 2010-08-11 09:44:49
    3 months 30 days : 2010-12-08 09:44:49
      march 30, 2011 : 2011-03-30 00:00:00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my program I am taking user input and parsing it into a 2d
I'm writing a game which is taking user input and rendering it on-screen. The
I am taking in a string from user input, and splitting it on whitespace
Taking CPU affinity into account, will such an environment be useful with threading? Or
We would like to mimic taking user input one letter at a time (intended
Basically, I'm taking user input and passing it to a javascript function in a
I am trying to create table in java by taking in user input. So
My co-worker is challenged with taking user input in Flex and using that data
I am taking user input through UI, and I have to validate it. Input
I have a PHP page whose purpose is taking user information for job recruitment.

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.