Below are three ways to return time zone information from a datetime value in Oracle Database.
Continue readingTag: dates
About the RM Format Element in Oracle
In Oracle Database, the RM
format element allows you to return the month in roman numerals when using the TO_CHAR()
function.
You can also use the fm
modifier to suppress any padding.
2 Ways to Find Out Which Quarter a Date Belongs to in MariaDB
If you ever need to find out which quarter a date belongs to in MariaDB, here are two functions that will allow you to do just that.
Continue readingHow to Get the Century from a Date in Oracle
With Oracle Database, we can use the TO_CHAR(datetime)
function to return the century from a datetime value.
To do this, we can use either the CC
format element, or the SCC
format element. We can combine these with other format elements to do things like, display the ordinal number, spell out the century, etc.
Subtract Seconds from a Datetime Value in MariaDB
Here are some options for subtracting one or more seconds from a datetime expression in MariaDB.
Continue readingHow to Remove Leading Zeros From Dates in Oracle
In Oracle Database, you can use the fm
(fill mode) format modifier to suppress any leading zeroes that might be applied to a date. This format modifier suppresses padding, which includes leading zeros and trailing blanks.
To use the fm
format modifier, include it in your format model when specifying how dates should be formatted. For example when using the TO_CHAR()
function to format dates, or in NLS parameters such as the NLS_DATE_FORMAT
parameter when setting the date format for your current session.
RR vs YY in Oracle
When formatting dates in Oracle Database, we have the option of using RR
and YY
to return a two digit year.
These two format elements are similar. The difference is in how they interpret two digits years.
We also have the option of using RRRR
and YYYY
when returning four digit years.
Subtract Microseconds from a Datetime Value in MariaDB
Here are some options for subtracting one or more microseconds from a datetime expression in MariaDB.
Continue readingHow to Remove the Trailing Spaces after the Month Name in Oracle
If you’ve ever used the TO_CHAR()
function to format a date that uses the month name, you might have noticed that sometimes the month is returned with right padding.
3 Ways to Separate the Year, Month, and Day from a Date in MariaDB
MariaDB has several functions that enable you to extract various date and time parts from date/time values. You can use these to separate each date/time component into its own column if required.
Below are three ways to extract the year, month, and day from a date value in MariaDB.
Continue reading