Jump to content

Date Conversion Problem


lilywong

Recommended Posts

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 !
Link to comment
Share on other sites

$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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.