Is there a Python module to parse a date like the 'date' command in Linux?

Mike Dewhirst miked at dewhirst.com.au
Thu Jun 1 02:53:01 EDT 2023


On 24/05/2023 6:00 pm, Mike Dewhirst wrote:
> On 23/05/2023 7:16 pm, Chris Green wrote:
>> Mike Dewhirst<miked at dewhirst.com.au>  wrote:
>>> [-- multipart/mixed, encoding 7bit, 22 lines --]
>>>
>>>      [-- text/plain, encoding base64, charset: UTF-8, 16 lines --]
>>>
>>> On 21/05/2023 5:53 am, Chris Green wrote:
>>>> I'm converting a bash script to python as it has become rather clumsy
>>>> in bash.
>>> What is the use case?
>>>
>> A script I use to create diary entries, so it's very handy to be able
>> to give the date as 'yesterday' or 'friday'.
>
> OK - I thought maybe baklabel might suit, but that delivers a day-name 
> (backup filename prefix) for today or a given date

I have just refreshed baklabel on PyPI and upped it from my local svn 
server to github [1]

The changes include resolving ambiguous dates across locales eg USA vs 
Australia 5/6/2023 being detected as May in USA and June in Australia on 
the assumption that the user knows what is required.

[1] https://github.com/mdewhirst/baklabel

>
>
>
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Your
> email software can handle signing.

-- 
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://mail.python.org/pipermail/python-list/attachments/20230601/0e1793fa/attachment.sig>


More information about the Python-list mailing list