Gossamer Forum
Home : Products : DBMan : Customization :

Time (Invalid date format)

Quote Reply
Time (Invalid date format)
Hello!

I have a simple database where i need to call up both date and time (I managed to have time Pacific Standard), any way; the date/time should come up auto for both add and modify --- BUT, I get the error: Time (Invalid date format) when trying to add a record.

Try it here:http://www.cspweb.net/cgi-bin/monster/db.cgi use: author/author

db.cgi is here: http://www.cspweb.net/db.cgi.txt
html.pl is here: http://www.cspweb.net/html.pl.txt
default.cfg is here: http://www.cspweb.net/default.cfg.txt

I did use the forum to get this far - the thread seemed to end with this same difficulty.

Thanks!

Jim

Thread Used: http://www.gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=DBCust&Number=93671&page=&view=&sb=&vc=1#Post93671

Quote Reply
Re: Time (Invalid date format) In reply to
Welp...I could not access your files. Both MIE and Netscape timed out. You might want to check with your hosting company to see if there is an routing problems or conduct a tracert to see if there is an WAN routing problems.

Regards,

Eliot Lee

Quote Reply
Re: Time (Invalid date format) In reply to
Thanks Eliot,

It should be okay to look now - have had a TERRIBLE time with new host - if anyone want to know who NOT to re-sell with let me know!

Should you have a moment please take a look at files; this is a project for my office (boss).

BTW: I don't need the day AND time in same field - but I do need both, they could come up in different fields.

Thanks,

Jim

Quote Reply
Re: Time (Invalid date format) In reply to
The problem is with the following codes:

Code:

my ($mon, $day, $year, $time, $ampm) = split(/ /, $date);
my ($hour, $min, $sec) = split(/:/, $time);


You are splitting values twice, which I believe is the source of your problem.

Here are some suggestions:

1) Use the default sub get_date codes for printing the date in the database. Then use a conversion sub-routine to print the date and time in your web pages.

2) Use a hidden field in your sub html_record_form routine like the following:

Code:

<input type="hidden" name="Time" value="$rec{'Time'}">


BTW: You do NOT need single quotation marks for field names that contain only one word. Single quotation marks are only used for field names with more than one word.

Example:

Code:

Read_FAQ


OR

Code:

'Visit Resource Center'


Regards,

Eliot