Gossamer Forum
Quote Reply
Time
Does anyone know how to print or stamp each database entry with the time and date?



Thanks in advance,

Dave
Quote Reply
Re: [dhoefler] Time In reply to
Try changing this (in default.cfg - assuming you haven't changed any of the fields yet):
Code:
Date => [4, 'date', 12, 15, 1, &get_date, ''],

to this:
Code:
Date => [4, 'alpha', 30, 30, 1, &get_date . ' ' . &get_time, ''],

Notice that I changed the type from date to alpha and &get_date to &get_date . ' ' . &get_time
(I also made the fields longer in case I wanted to use auto-generate)

It works like this:
1. &get_date calls the subroutine from db.cgi to get the date.
2. The . (period) tells the script to combine it with something
3. The "something" in this case is: ' ' (which is literally a space) - you could do ' -- ' or ' at ', etc.
4. and then combine that with &get_time.

This will return the date & time in the following format: 11-Sep-2003 15:15:50 (or you could do: 11-Sep-2003 at 15:15:50)

Last edited by:

Watts: Sep 11, 2003, 12:32 PM