close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Insert/Update DateTime Record with now()

Thread began 11/05/2010 4:35 pm by sorenson3241 | Last modified 11/06/2010 11:11 am by sorenson3241 | 856 views | 5 replies |

sorenson3241

Insert/Update DateTime Record with now()

I am working on an employee time card website page. In DataAssist I am using 'Update Record Wizard'.

When an employee clicks on a Clock In page. The page list what their daily assignments are.

They then click a submit button and it trigger the 'Insert Record' behavior. This behavior inserts the records creating an ID and adding the employee name via a URL parameter. I also want to insert 'now()' into a clockin field.

In the insert record wizard if I set the 'Value' (page 2) of the checkin field to 2010-11-5 it inserts it with no problems. If I set the the 'Value' of the checkin field to now() or current_date() it puts 0000-00-00 into the datetime field.

I want to repeat this process when they checkout using 'Update Record' wizard.

How do I configure DataAssist to insert the current_date() or now()???

Bob

Sign in to reply to this post

Dave BuchholzBeta Tester

Bob,

make the field an integer field I usually use int(11) like so in my set-up sql file

`tstampinsert` int(11) unsigned DEFAULT NULL COMMENT 'Insert Timestamp use <?php echo time(); ?> in a hidden field in your form',



and as the comment says set up a hidden field with the value as

php:
<?php echo time(); ?>



and insert that field when using the DA wizard

Sign in to reply to this post

sorenson3241

David,

Thank you for the reply. I now have "1289008548" in the 'checkin' field.

I now need to display a column of all the employee 'checkin' times in repeating recordset region formated as a regular date '2010-11-05 12:58:33' not the 10 digit integer. How do I do the conversion or reformatting.

I also need to do the conversion for a column of 'checkout' date/times.

Finally, I need to substract the 'checkout' time from the 'checkin' time and get the elapsed time worked.

Thank you again for any help.

Bob Sorenson

Sign in to reply to this post

this_is_me

timestamp?

a mysql - timestamp field (length=14) would do this automatically on changing or inserting new data.

Sign in to reply to this post

Dave BuchholzBeta Tester

Bob,

see function.date.php for details on how to format unix timestamps and there is a good example on how to calculate time differences here b-16.html

Sign in to reply to this post

sorenson3241

To member 'this_is_me'. I have two timedate fields. Checkin and Checkout. Mysql will NOT allow me to have two timestamps. It would make it much easier if it did.

To member Dave. Thank you for the help. I just wish there was an easier way to handle imputting multiple date fields.

To Webassist. Add to DataAssist the ability to add a Mysql Function Now() or current_date() as a value in a date field.

Best,

Bob

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...