<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dates on BareSQL.com</title>
    <link>https://baresql.com/tags/dates/</link>
    <description>Recent content in Dates on BareSQL.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 26 Oct 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://baresql.com/tags/dates/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Adding 1 to a Date Gives the Next Day on PostgreSQL and a Number on MySQL and SQLite</title>
      <link>https://baresql.com/adding-1-to-a-date-gives-the-next-day-on-postgresql-and-a-number-on-mysql-and-sqlite/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/adding-1-to-a-date-gives-the-next-day-on-postgresql-and-a-number-on-mysql-and-sqlite/</guid>
      <description>&lt;p&gt;&lt;code&gt;due_date + 1&lt;/code&gt; reads like the day after, and on PostgreSQL that is what it gives. On MySQL, MariaDB and SQLite the answer is a plain number.&lt;/p&gt;&#xA;&lt;p&gt;MySQL and MariaDB turn the date into the number 20240131 and add 1. SQLite turns the text into the number 2024. PostgreSQL adds a day. Subtracting two dates goes the same way: PostgreSQL counts days and MySQL and MariaDB subtract the numbers. INTERVAL arithmetic works on PostgreSQL, MySQL and MariaDB, with different result types, and SQLite has no INTERVAL. PostgreSQL’s usual INTERVAL &#39;1 day&#39;, with the unit inside the quotes, works on PostgreSQL only.&lt;/p&gt;</description>
    </item>
    <item>
      <title>CAST to DATE Returns the Number 2024 on SQLite Because It Has No Date Type</title>
      <link>https://baresql.com/cast-to-date-returns-the-number-2024-on-sqlite-because-it-has-no-date-type/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/cast-to-date-returns-the-number-2024-on-sqlite-because-it-has-no-date-type/</guid>
      <description>&lt;p&gt;Filtering orders with &lt;code&gt;CAST(created_at AS DATE) = &#39;2024-05-06&#39;&lt;/code&gt; works on PostgreSQL, MySQL and MariaDB. SQLite has no date type, turns the CAST into a number and keeps only the year, so the filter never matches.&lt;/p&gt;&#xA;&lt;p&gt;SQLite keeps dates as text or numbers and reads a CAST to DATE, DATETIME or TIMESTAMP as a conversion to a number, which keeps only the leading digits. MySQL and MariaDB also refuse CAST(x AS TIMESTAMP), and PostgreSQL refuses DATETIME.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
