Combining separate date input elements into one date
Moderator: General Moderators
- edawson003
- Forum Contributor
- Posts: 133
- Joined: Thu Aug 20, 2009 6:34 am
- Location: Los Angeles, CA - USA
Combining separate date input elements into one date
I would like to take user input in the above date field format and combine the date elements and post it to my mysql table. How can I set that up?
Re: Combining separate date input elements into one date
date = YYYY + "-" + MM + "-" + DD
How much thought have you put into this?
How much thought have you put into this?
- edawson003
- Forum Contributor
- Posts: 133
- Joined: Thu Aug 20, 2009 6:34 am
- Location: Los Angeles, CA - USA
Re: Combining separate date input elements into one date
thanx for the info tasairis; however, if you think certain posts are too elimentary and not worth your time, I suggest next time don't bother responding.
This is more like what I was looking to get as a response
More useful and less snarq!
This is more like what I was looking to get as a response
Code: Select all
<? $todo=$_POST['todo'];
if(isset($todo) and $todo=="submit"){
$month=$_POST['month'];
$dt=$_POST['dt'];
$year=$_POST['year'];
$date_value="$month/$dt/$year";
echo "mm/dd/yyyy format :$date_value<br>";
$date_value="$year-$month-$dt";
echo "YYYY-mm-dd format :$date_value<br>";
}
?>
Re: Combining separate date input elements into one date
1. We don't like giving solutions. We give hints and clues and suggestions.
2. You didn't provide enough information for such a detailed answer as you wanted. How did I know what the fields were called? How did I know that the month field was going to give a zero-padded two digit number and not a month name? How did I know about this "todo" stuff?
3. It's spelled "snark".
2. You didn't provide enough information for such a detailed answer as you wanted. How did I know what the fields were called? How did I know that the month field was going to give a zero-padded two digit number and not a month name? How did I know about this "todo" stuff?
3. It's spelled "snark".
- edawson003
- Forum Contributor
- Posts: 133
- Joined: Thu Aug 20, 2009 6:34 am
- Location: Los Angeles, CA - USA
Re: Combining separate date input elements into one date
By the way, who's "we"? The Federation forum contributors? Of which, I'm guessing your the president...
And while your at it, correcting mispellings and such, you should go ahead and check your grammar.
Correct:We give hints, clues and suggestions.
Thanks for playing!
P.S.
Check out: Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation
by Lynne Truss
We of the the Snarqqq Society give this book two thumbs up.
And while your at it, correcting mispellings and such, you should go ahead and check your grammar.
Code: Select all
We give hints [color=#FF0000]and[/color] clues [color=#FF0000]and[/color] suggestions.Thanks for playing!
P.S.
Check out: Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation
by Lynne Truss
We of the the Snarqqq Society give this book two thumbs up.