PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 30th, 2002, 09:28 AM
alex alex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 2 alex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
php date functions

Hello there!!!!!!!!!
I am trying to work with checking and calculation of dates using php.
Do you know how can I check that a date that a user is entering is the correct?( i.e 31 of february is not a valid date...or to check the entered date against the current date?)

Do you know also how can I calculate the number of days? For example when a user is selecting a start date and an end date, how can I calculate the number of days between them? (i.e february has 28 days, july 31 days etc.).
I hope i dont ask too much
Thanks a lot

alex

Reply With Quote
  #2  
Old July 31st, 2002, 04:17 AM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi Alex,
http://www.php.net/date has explanations for everything you need to know. It's a great reference for the PHP DATE() function so I would recommend you check that out as your first point of support

Reply With Quote
  #3  
Old November 23rd, 2002, 02:14 AM
serg4444 serg4444 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 16 serg4444 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can make like that:

switch($x){

case "january":
$days=31
break;

case"february":


etc.

Sincerely,
Sergey Booyny
AlarIT programmer
http://www.AlarIT.com

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php date functions


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