Perl script: issue with dates [message #408450] |
Tue, 16 June 2009 04:49 |
f_vinodh
Messages: 3 Registered: June 2009
|
Junior Member |
|
|
Hi
I have one another Q
i implemented an sqlquery in perl as follows
my $sth1 = $db->prepare("SELECT TO_CHAR(SYSDATE, 'YYYYMMDDHHMISS') from dual") or die "Couldn't prepare statement: " . $db->errstr;
my @dat1;
$sth1->execute() or die "Couldn't execute statement: " . $sth1->errstr;
@dat1 = $sth1->fetchrow_array();
print $dat1[0];
print $dat1[1];
i am getting the out put as "20090616034633"
but if i execute the statement directly in SQL Prompt, i am getting the CORRECT out put as follows
SQL> SELECT TO_CHAR(SYSDATE, 'YYYYMMDDHHMISS') from dual;
TO_CHAR(SYSDAT
--------------
20090616064754
SQL> !date
Tue Jun 16 06:47:57 EDT 2009
Can you please help me why there is a difference in time
direct query says the hour is 06 (which is correct)
Query thru perl script , hour is 03(which is wrong)
Please explain where i am missing
Thanks in advance
Regards
Vinodh
|
|
|
|
Re: Database connection Problem [message #408463 is a reply to message #408450] |
Tue, 16 June 2009 05:45 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Also post your query in the correct forum.
If it is SQL, post in SQL & PL/SQL but remove Perl stuff.
If it is Perl issue, post in Open Database Interfaces.
Topic is split and move to this latter one for the moment.
Regards
Michel
[Updated on: Tue, 16 June 2009 05:46] Report message to a moderator
|
|
|
|