PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Bernd dot Brinkmann at Bertelsmann dot DE
Subject: Re: DateTime Values
Date: Nov 18 1997 6:32PM

Thanks for replying, Michael.

But the default datetime format is different on some locations. While
snooping around in my company, i found several output formats for the
datetime-type. To change this behavior, a call to cs_dt_info(cs_set,
cs_dt_convfmt) has to be made. I hacked this into my version of
CTlib.xs, but i think this function is important enough to get into
sybperl 2.09 (like cs_locale).

Bernd

 ----------
Von: Michael Peppler
An: SYBPERL-L@trln.lib.unc.edu
Betreff: Re: DateTime Values
Datum: Donnerstag, 13. November 1997 16:50

Bernd.Brinkmann@Bertelsmann.DE wrote:
>
> As I am quiet new with Sybperl, I have encounterd a problem -
> Can anyone give me a clue, if there is a possibility to retrieve a
> DateTime value (date and time) without using "UseDateTime" followed by
a
> $date->crack.
> I need this for a fast (!!!) output-routine that dumps large amounts
of
> data (> 1.500.000 rows gathered by joins, etc.) and therefore a
> conversion inside a while-loop is too time consumpting.

How do you need your data converted?

You could write your queries to return the date and the time
portion separately (using convert()), or you could use some
fancy split() or pattern match to extract the appropriate fields.

The default datetime format is

Nov 13 1997  7:47:05:293AM

which could be matched by something like

$date =~ /(\w+) +(\d+) +(\d+) +(\d+):(\d+):(\d+):(\d+)(\w+)/;
$mon = $1;
$day = $2;
$year = $3;

etc...

Michael
 --
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler