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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:29:24+00:00 2026-06-13T04:29:24+00:00

I am currently working on a package manager for my current project and I

  • 0

I am currently working on a package manager for my current project and I need to add package subscription date and package expiry date.

I am using php function date("Y-m-d H:i:s") i.e

$package_subscription_start_date = date("Y-m-d H:i:s");

now here is my requirement:
I need to have packages such as for 1 day, 2 days, 5 days, 1 week, 4 weeks, 12 weeks, 1 month, 6 months, 9 months, 1 year, 2 years, 5years and 10 years.

How is it possible for me to add these values and calculate the package expiry date for inserting into mysql, something like

$package_expiry_date = date("Y-m-d H:i:s") + 1 day;
$package_expiry_date = date("Y-m-d H:i:s") + 5 days;
$package_expiry_date = date("Y-m-d H:i:s") + 1 week;
$package_expiry_date = date("Y-m-d H:i:s") + 4 weeks;
$package_expiry_date = date("Y-m-d H:i:s") + 2 months;

$package_expiry_date = date("Y-m-d H:i:s") + 2 years;

Lastly I need to take care of other date issues like valid date and leap year etc.
Also I need this to be done at php level, not using mysql / sql query.

I will appreciate any help in this direction.

  • 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-06-13T04:29:25+00:00Added an answer on June 13, 2026 at 4:29 am

    Have you tried the strtotime() command in php?

    echo $expires = strtotime(date("Y-m-d H:i:s")." + 1 day");
    echo date("Y-m-d H:i:s", $expires);
    

    Gives you the output of

    135082420020
    12-10-21 08:56:40
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a project where in which I need to package
I am currently working on a package subscription manager where I have to calculate
I'm currently working on a NuGet package which need to configure a couple of
In the current package that I am working on for a project I have
Currently working with the following package structure: /package __init__.py final.py /write __init__.py write.py /data
I had been trying to add tests to a project I'm working on. The
I'm currently working on a fairly large project that has been migrated from Ant
I'm currently working on an SSIS package to load mainframe logs from multiple server/file
I'm working on a project that i have to use ruby 1.8.7. I'm using
I'm working on developing a Firefox add-on using the Add-on SDK . I changed

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.