Subject Re: Date Format in FireBird
Author skotaylor
--- In ib-support@yahoogroups.com, "desmondtay88"
<desmond_nnwong@p...> wrote:
> Probably this had been posted couple of times in this forum, but im
> pretty new to firebird and need some help. Seems like by default the
> db is taking mm-dd-yy as the format for date input. Wondering how
> can I change this to dd-mm-yy format instead. im running on win98,
> tried changing the system short date format, but doesnt help. also
> im accessing the db thro' perl. i've tried $dbh->{ib_dateformat} = %
> d-%m-%y. it helps on the output, but for input it is still expecting
> mm-dd-yy.

Heh, I was just working on a Perl script and I didn't know the IB
driver had that useful little format property. So, I wrote a quick
little function to swap the day and month around.

sub dtSwap {
my ($d) = @_;
my @td = split /([-\/])/, $d;
$d = $td[2]."/".$td[0]."/".$td[4];
return $d;
}

You could use that to do the reverse.


> btw, im trying to port sql-ledger to firebird, any folks out there
> have already done that and like to share...

Sure, email me off list and I'll send you the converted sql scripts.
I just did them up last week.

<blah blah blah>
Still lots of work to do inside the perl scripts though: Warning
switch (#!/usr/bin/perl -w) needs to be turned on and "use strict;"
should be added to the scripts, making it even more fun to debug.
Then there is a lot of SQL to fix too. Dieter Simader, has make a
great start to a Web based accounting program and it's a great, free,
accounting system for the average geek/consultant/hacker dewd. :)
</blah blah blah>

Scott.