Topic Options
Rate This Topic
#94171 - 01/05/04 03:18 AM Perl API Querying
neil_anderson_uk Offline
Stealth Member

Registered: 03/11/04
Posts: 6
**
ARS 5.01.02, Solaris 8, oracle 8.1.7

I've created a form where users can enter an advanced query into a field. On the click of a button that query is copied to a hidden field and \'s are added at the ' and "s. This query is then passed to a PERL script on the server using @@:. The server runs the query produces a report and emails it to the requesting user.

This works great until we try dates. If we put in the query 'Create Date' >= "19/9/03" for example and turn on SQL logging we find that the actual query contains the date number 1567465200, which when translated back is 3/9/2019 (BST). We've tried a few others and it seems that the API is reversing our dd/mm/yy and reading it as yy/mm/dd and moving to BST (we are in GMT at the mo).

Has anybody got a work around for this? I suspect I need an ENV variable setting, but I don't know what.

Neil Anderson
HBOS plc (UK)


Neil Anderson
HBOS plc



Yahoo! Messenger - Communicate instantly..."Ping" your friends This posting was submitted via the Web interface today! Download Messenger Now

Top
#94172 - 01/05/04 04:15 AM Re: Perl API Querying [Re: tim_hodges]
twidowfield Offline
enthusiast

Registered: 03/11/04
Posts: 326
Neil,

It's possible your Solaris machine's locale is set with an LCTIME that
expects dates to be written as YYYY/MM/DD or YY/MM/DD. You can set the
locale to the old standard C to change it. For example:

When the locale's time variable is set to French Canadian (sorry -- I
don't have any European locales loaded):

$ export LCTIME=frCA
$ date +%x
2004-01-05

When the locale is set to C:

$ export LCTIME=C
$ date +%x
01/05/04

Try changing the environment variable in the shell or inside the script.
To do it on the same command line (temporarily, just for the duration
of the script), try this:

@@:export LCTIME=C;foo.pl

--Tim Widowfield, UWIP

Neil Anderson wrote:
> **
> ARS 5.01.02, Solaris 8, oracle 8.1.7
>
> I've created a form where users can enter an advanced query into a
> field. On the click of a button that query is copied to a hidden field
> and \'s are added at the ' and "s. This query is then passed to a PERL
> script on the server using @@:. The server runs the query produces a
> report and emails it to the requesting user.
>
> This works great until we try dates. If we put in the query 'Create
> Date' >= "19/9/03" for example and turn on SQL logging we find that the
> actual query contains the date number 1567465200, which when translated
> back is 3/9/2019 (BST). We've tried a few others and it seems that the
> API is reversing our dd/mm/yy and reading it as yy/mm/dd and moving to
> BST (we are in GMT at the mo).
>
> Has anybody got a work around for this? I suspect I need an ENV
> variable setting, but I don't know what.
>
> Neil Anderson
> HBOS plc (UK)
>
>
> Neil Anderson
> HBOS plc
>
> ------------------------------------------------------------------------
> * Yahoo! Messenger*
>
> - Communicate instantly..."Ping" your friends
>
> UNSUBSCRIBE or access ARSList Archives at http://www.ARSLIST.org
> (Support: mailto:support@arslist.org ) ARSList is hosted by QMX SUPPORT
> SERVICES at www.QMXS.com This posting was submitted via the Web
> interface today! *Download Messenger Now*
>
>




Top


Moderator:  Matt Reinfeldt