Skip to content

Support for capitalisation in date formatting #818

Open
@virresh

Description

@virresh

Feature Request

In glibc strftime, we have the ^ operator which provides this functionality. However, it's not cross-platform, and surprisingly there exists no clean way to uppercase alphabets in Windows. I have faced this issue and am looking for an alternative that will allow me to do this in a platform-agnostic way. It is supported out of the box by Java's String.format().

PS: I can't just do .to_upper() to the string

A detailed example for such use case:

I need to generate get requests to a server, one day after another. The url paths on that server are case sensitive and I have multiple websites on which I need to do this testing. So essentially I need someting like:

requests.get('www.example.com/JUN/06/2020/file.csv')
requests.get('www.example.com/JUL/06/2020/file.csv')
requests.get('www.example.com/AUG/06/2020/file.csv')

On glibc, I can simply do:

date.format('www.example.com/%^b/%d/%Y/file.csv')

and get the desired file because it supports capitalisation. However, there is no clean alternative to do the same in windows. I'm hoping Arrow would bridge the gap.

In, fact, if feasible, it'll be a great addition if arrow can support all glibc extensions.

Pardon me if arrow already supports this, but I couldn't figure it out from the documentation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions