Jump to content


Photo

Date Conversion Problem


  • Please log in to reply
1 reply to this topic

#1 lilywong

lilywong
  • Members
  • PipPipPip
  • Advanced Member
  • 56 posts

Posted 18 April 2006 - 06:44 AM

I have 4 text boxes to be filled with date (txtDate1, txtDate2, txtDate3, txtDate4), only txtDate1 need to be filled, the rest will be filled automatically by increment one based on txtDate1.

however, is there any way to check whether the particular date is sunday ? if it is sunday, the date will be skipped and the following date is added.

In this case for example,
1/1/2006 (friday)
2/1/2006 (saturday)
3/1/2006 (sunday)
4/1/2006 (monday)
5/1/2006 (tuesday)

so the 3/1/2006 will be skipped.
so txtDate1 will be 1/1/2006, txtDate2 will be 2/1/2006 , txtDate3 will be 4/1/2006 , txtDate4 will be 5/1/2006 .

thank you so much !


#2 Roberto

Roberto
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationLondon, England

Posted 18 April 2006 - 07:48 AM

$dayNumber=date("w", mktime([int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] ))


will give you a number from 0 to 6, with 0 being Sunday. You need to fill in some of the variables in mktime.

Rob
*************************************
Mad Mouse Media Web Design
t: (+34) 610 837 558
e: rob@madmousemedia.co.uk
w: www.madmousemedia.co.uk
w: www.madmouseart.com *************************************




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users