Gossamer Forum
Home : Products : DBMan : Discussions :

Date Format

Quote Reply
Date Format
Hi,
Me again! Just a quicky, I want my date format to be DDMMYY and not DD-MM-YY! Is there a way to remove the -? I have removed it from under the date_to_unix subroutine
my ($day, $mon, $year) = split(/-/, $_[0]); but it then says "Invalid date format"
Does anyone have any ideas? I'd be very greatful!
Ben Blackmore

Quote Reply
Re: Date Format In reply to
bjblackmore, please try and keep your posts to one board only. You have posted the same question on 3 different boards, it can become quite complicated if people help out in one forum, then 2 days later, someone else answers the same question on a different board.

In answer to your question, there are two date sub-routines sub get_date and sub date_to_unix. If you edit one, you need to edit the other to make them compatible.

Good luck!

- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Date Format In reply to
Sorry wasn't sure which board that question would come under! As for the question I have changed the date_to_unix subroutine in the following way!
my ($day, $mon, $year) = split(/-/, $_[0]);
my ($day,$mon,$year) = split(//, $_[0]);
But what do I change under the get_date routine? I can't see anywhere where it says about using a - to separate the dates!
Regards
Ben

Quote Reply
Re: Date Format In reply to
The way the date subroutine works, it needs some sort of character to separate each portion of the date (ie: day-month-year). If you take out that separator, you wind up with a date of "daymonthyear" and DBMan doesn't know where each portion starts and finishes (which it needs to convert dates to UNIX format).

If you have a "Date" field in your database, perhaps a better idea would be to keep the dashes in the date, but take them out when you display the record?

Regards,

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/