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 990279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:55:26+00:00 2026-05-16T05:55:26+00:00

actually I save date in database in varchar format. firstly I retrieve date from

  • 0

actually I save date in database in varchar format.
firstly I retrieve date from databae & store it into $date.
now i want to perform addition of 5 days with $date1.

when i search on internet i got this code :

$date = date('Y-m-d', strtotime("+5 days"));

now can you tell me how I insert $date1 value to this code for get expected result.

  • 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-16T05:55:27+00:00Added an answer on May 16, 2026 at 5:55 am

    Working with strtotime you could to something like this:

    <?php
    
    $date = "2010-04-01";
    
    echo date("Y-m-d", strtotime("+5 days", strtotime($date))); // 2010-04-06
    

    The first strtotime($date) call converts the string into an timestamp integer, the secound call takes that integer and adds 5 days to it. Then date formats it back into a string


    On a sidenote:

    There is not really a need to save a date as a varchar since mysql (which i guess is what you are using from the tag) will also work with “DATETIME” fields for you. E.g. SELECT DATETIMEFIELD FROM table will return ‘2010-01-01 00:00:00’ or a “DATE” field will return “2010-01-01”, both are strtotime parseable 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL database table that has a VARCHAR field storing a date
I am trying to retrieve data from the database with the following query: select
Actually I can save it in swf and in avi formats. Is there any
I had a quick question. Is it possible to save a file without actually
Actually I am new to jquery as well as web designing Now I need
Actually i want that, suppose i have a colorcode #FF3366. How can i examine
For Yii framework, can we set attribute for save function using object results from
Actually i have created an app from which i can stored notes to my
I have a Form (Compact Framework, actually) with a few fields, a date and
I want to create a shellscript that reads files from a .diz file, where

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.