ukweb Posted June 19, 2007 Share Posted June 19, 2007 Hi, I'm using a date picker to choose a date. the format of the date entered into the textbox is yy/mm/dd From this how can I work out the day of the week from the entered date? I need this as the first day has to be a sat, and if it isnt my form will tell the user to choose a saturday. Is there a simple way of doing this? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/56232-work-out-day-of-week-from-given-date/ Share on other sites More sharing options...
akitchin Posted June 19, 2007 Share Posted June 19, 2007 you could use date() with a format that gives the day of the week using the timestamp calculated from the input: $timestamp = mktime(0, 0, 0, $input{3}.$input{4}, $input{6}.$input{7}, $input{0}.$input{1}); $day_of_week = date('D', $timestamp); Quote Link to comment https://forums.phpfreaks.com/topic/56232-work-out-day-of-week-from-given-date/#findComment-277743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.