[PATCH] Add a new pattern for zero-based months for Date/Time Formatting

From: Vincent Moreau <vincentneko(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Add a new pattern for zero-based months for Date/Time Formatting
Date: 2025-03-24 10:45:19
Message-ID: CAHZj6Fikr-t-QbZX1OR6wVQFNMFyLjRHFM9oc=2K=-NDJG6eZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I came across date information from an external data source where the
month number is zero-based (January = 0, December = 11) and found that
I couldn't process it directly using the TO_DATE function.
This patch introduces a new pattern (MZ) for handling zero-based
months in Date/Time Formatting.

## Example

SELECT to_date('01012025', 'DDMZYYYY');
to_date
------------
2025-02-01

## Implementation notes

This is my first patch submission. I have tried to follow the
guidelines from various documents, but please let me know if anything
is missing or not aligned with expectations. My apologies in advance
for any oversights.

Thanks,
Vincent Moreau

Attachment Content-Type Size
Add-mz-pattern.patch application/octet-stream 4.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2025-03-24 10:46:07 Re: POC, WIP: OR-clause support for indexes
Previous Message Yura Sokolov 2025-03-24 10:41:17 Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum