Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Last Modified filed?

Quote Reply
Last Modified filed?
Hi there

How do I add hidden date field, which would get last modified date? Without using <%Dbsql::HTML::generate_add_form%>

Well I found the timestamp thingy, but it displays time in 20011202 instead of 2001-12-02...
And do I need to assign hidden value of "" (Nothing) for it on my forms?


Thanks

Last edited by:

Suomi: Dec 2, 2001, 12:00 PM
Quote Reply
Re: [Suomi] Last Modified filed? In reply to
I am looking for date format here:

http://www.mysql.com/...al_toc.html#DATETIME

And still could not get the timestmp to split ie 2001-12-03...
it just shows it all together... 20011203... I know there is a way to get the format changed, but how. Could not find it in the sample files either...

I tried to set up default value:
0000-00-00 00:00:00
0000-00-00

but it always comes up as null value, no matter what I put in it.

Thx

Last edited by:

Suomi: Dec 3, 2001, 10:16 AM
Post deleted by TheStone In reply to
Quote Reply
Re: [Suomi] Last Modified filed? In reply to
Hi,

Quote:
How do I add hidden date field, which would get last modified date? Without using <%Dbsql::HTML::generate_add_form%>
I think just add a date field into your table which is formated HIDDEN on Form Type.

Quote:
Well I found the timestamp thingy, but it displays time in 20011202 instead of 2001-12-02...
And do I need to assign hidden value of "" (Nothing) for it on my forms?

You can use date_set_format to change the format. You pass in a format string:
%yyyy%-%mm%-%dd%
%dd%-%mmm%-%yyyy%
%ddd% %mmm% %dd% %yyyy%

Eg.
require GT::Date;
date_set_format('%mm%-%dd%-%yyyy%');
my $cur_date = GT::Date::date_get();

Cheers,
TheStone

B.
Quote Reply
Re: [TheStone] Last Modified filed? In reply to
Sounds good, little confused tough... Can I add this to the templates directly, or where?
Quote Reply
Re: [Suomi] Last Modified filed? In reply to
Hi,

Actually, it should save the current date if the table has a date field.

Cheers,
TheStone.


B.