Subject | RE: [firebird-support] Extracting Time |
---|---|
Author | Helen Borrie |
Post date | 2003-06-26T03:17:31Z |
At 12:55 PM 26/06/2003 +1000, you wrote:
SELECT CAST (
EXTRACT (HOUR FROM aTimestamp)
+ EXTRACT (MINUTE FROM aTimestamp)
+ EXTRACT (SECOND FROM aTimestamp)
AS TIME) as TimeOfDay
....
You will still get fractions of a second (not milliseconds: that's
Delphi; the Firebird fraction is ten-thousandths of a second) but they
will be .0000.
TIMESTAMP and there was no TIME type at all.
***Shame????*** Whoa! The new types not only make it much easier to get the
date (day) and time separately but they also make the date/time handling
conformant with the SQL standard.
heLen
>The cast statement returns milleseconds... pity - I'll have to do someAnother thing you can use is the EXTRACT() function:
>client side work on it.
SELECT CAST (
EXTRACT (HOUR FROM aTimestamp)
+ EXTRACT (MINUTE FROM aTimestamp)
+ EXTRACT (SECOND FROM aTimestamp)
AS TIME) as TimeOfDay
....
You will still get fractions of a second (not milliseconds: that's
Delphi; the Firebird fraction is ten-thousandths of a second) but they
will be .0000.
>It's a shame that the new dialect lost the simplicity of date and time beingHmm, that's not a true assumption. The old DATE type was like the new
>exactly that when it added the new data types.
TIMESTAMP and there was no TIME type at all.
***Shame????*** Whoa! The new types not only make it much easier to get the
date (day) and time separately but they also make the date/time handling
conformant with the SQL standard.
heLen
>Alan
>
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/