Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 8th, 2004, 05:48 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
add 6 months to now()

this is really simple I know but I can not seem to find any thread on this or how to do it.

I would like to know how to add 6 months to today's date as an expiration of an account when someone signs up in my MySql database.

Where i am getting stuck is crossing over a new year or a month. THought there might be some function of formula where you could add maybe 180 days to now()
THanks for any idea's or threads...

Reply With Quote
  #2  
Old April 8th, 2004, 07:30 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: add 6 months to now()

This is much easier to do in PHP and then convert it in your MySQL query using something like FROM_UNIXTIME():
php Code:
Original - php Code
  1.  
  2. $t = mktime(0, 0, 0, date('m')+6, date('d), date('Y'));
  3. mysql_query("INSERT INTO table_name (expiration_date) VALUES (FROM_UNIXTIME('".$t."'))");


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > add 6 months to now()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT