Hi

I would appreciate if you could help me to change TIME_STAMP into
Formatted-Date when inserted into Database as DD MM YYYY 24HH:MM:SS;

I could do for ACCOUNTING, RADLOG.

For ACCOUNTING Table : Using AccColumnDef
AcctColumnDef   TIME_STAMP,Timestamp,formatted-date,to_date(''%e %m %Y
%H:%M:%S', 'DD MM YYYY HH24:MI:SS')

For RADLOG Table : Adding Few Lines on LogSQL.pm log() subroutine as below;
# Log a message
# $p is the message priority, $s is the message
sub log
{
    my ($self, $p, $s) = @_;

    if ($p <= $self->{Trace})
    {
        # (Re)-connect to the database if necessary,
        return undef
            if !$self->reconnect;

        my $time = time;

# Added for Date Formatting <start>
        my $format = "to_date('%e %m %Y %H:%M:%S', 'DD MM YYYY HH24:MI:SS')";

        # Use Date::Format to format an SQL date
        require "Date/Format.pm";

        # Convert a unix epoch date into an SQL date
        $time = &Date::Format::time2str($format, $time);
# Added for Date Formatting <end>

        $s = $self->{dbh}->quote($s);
        my $q = "insert into $self->{Table} (TIME_STAMP, PRIORITY, MESSAGE)
                values ($time, $p, $s)";
        $self->do($q);
    }
}

For RADONLINE : ???
How do I do it for RADONLINE Table

with regards
madhav



===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to