close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Date from Form to Database

Thread begun 9/10/2009 7:07 pm by jebrandon343719 | Last modified 9/10/2009 10:32 pm by tom92909 | 1789 views | 2 replies |

jebrandon343719

Date from Form to Database

Hi, How do I convert a date entered in a form in say a format like dd/mm/yy and convert it to a date that can be inserted into a database (which had a format yyyy-mm-dd)
Thanks

Sign in to reply to this post

anonymous

Do you want to do it with WebAssist tools? Or, the hard way where you have to use the explode command to get the various date parts split apart and then re-apply them into variable the correct order.

If you have Validation Toolkit, you can apply a client validation and define the accept value and then in the same dialogue box, it allows you to pick a format to convert it to. This method, however, does use javascript to reformat the date.

Sign in to reply to this post

tom92909Beta Tester

Is it required in the form for the user to actually enter the date in question? Or is the actual system date sufficient? You could create a hidden input in the form to include the desired date format for you. Perhaps the following is a simple alternative?

php:
<?php

$mydate 
date('Y-m-d');
?>

<form>
<input name="date" type="hidden" value="<?php echo $mydate;?>" />
</form>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...