MS SQL server and SQL DATETIME manipulation in perl
- From: "Bob" <tech2@xxxxxxxxxx>
- Date: 29 Apr 2005 01:23:33 -0700
Hi all,
I am going to be doing a lot of work with Microsoft SQL Server 2000
using perl and the Win32::ODBC module. Most of this will revolve around
date and time conversions, and as such I was wondering if anyone has
come up with a module(s) for converting between SQL Server DATETIME
strings and perls epoch serial numbers.
I have already checked the Date::Calc and Date::Manip modules from
CPAN, and they do not include such code.
MS SQL DATETIME types (ANSI SQL-92 standard?) should be delimited and
formated as follows, for server INSERTS statements:
'YYYYMMDD'
'YYYY-MM-DDTHH:MM:SS'
'YYYY-MM-DDTHH:MM:SS.xxx'
So for example I would like to go
from: 549929310551181, or Fri Apr 29 09:49:05 2005
to: 20050429, or 2005-04-29T09:49:05, or 2005-04-29T09:49:05.333
and vice-versa, and the time component as optional too, etc.
I am sure one of you guys out there has done this before, right?
Any ideas, suggestions, code, etc in how I should proceed would be
greatly appreciated. Thanks in advance.
.
- Follow-Ups:
- Re: MS SQL server and SQL DATETIME manipulation in perl
- From: Jonathan Leffler
- Re: MS SQL server and SQL DATETIME manipulation in perl
- From: Thomas Kratz
- Re: MS SQL server and SQL DATETIME manipulation in perl
- Prev by Date: Re: problems using Net::SSH::Perl in a while loop
- Next by Date: Re: Re: problems using Net::SSH::Perl in a while loop
- Previous by thread: problems using Net::SSH::Perl in a while loop
- Next by thread: Re: MS SQL server and SQL DATETIME manipulation in perl
- Index(es):
Relevant Pages
|
|