Gossamer Forum
Home : Products : DBMan : Customization :

&getdate : can be updated ?

Quote Reply
&getdate : can be updated ?
It is easy to put '&getdate' in the config file to have the date automatically filled out when a new record is created. Now it is possible to have the date UPDATED when a record is updated ?
Quote Reply
Re: &getdate : can be updated ? In reply to
This can easily be accomplished by modifying the sub modify_record routine in the db.cgi file by including the following line.

Code:
$in{'Date'} = &getdate;

It should work if you put this line just before:

Code:
$output .= &join_encode(%in);

which currently appears in the modify_record subroutine.

For more information on the subject read the thread on auto-incrementing dates!

Lauren
Quote Reply
Re: &getdate : can be updated ? In reply to
Thank you very much, Lauren. It works !.
I must just say, if someone else read this topic, that the right code is not "&getdate;", but "&get_date;"

Thanx, again.
Parsifal
Quote Reply
Re: &getdate : can be updated ? In reply to
Where do you put the date in the .cfg file so that it's added automatically when a new record is created??

Thanks!

Giorgos
Quote Reply
Re: &getdate : can be updated ? In reply to
Here is a possible code, a line of definition for a field in a config file :

Date => [16, 'date', 12, 15, 1, &get_date, ''],

&get_date is put in the field's default.

Parsifal