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: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: DateTime Values
Date: Nov 13 1997 3:50PM

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