whois icon indicating copy to clipboard operation
whois copied to clipboard

.im expiry date is format dd/mm/YYYY and not mm/dd/YYYY

Open Dryusdan opened this issue 2 years ago • 3 comments

Hi

I found a little inconsistency (registrar fault 😇 )

I created a small script to check the expiration of my domains and found that one of the domains does not return a date in mm/dd/YYYY but in dd/mm/YYYY. This domain is however parsed by PyWhois and return a datetime mm/dd/YYYY.

For example my domain dryusdan.im expire on 7 decembre 2022 but PyWhois set its expire on 12 july 2022. I would make a PR on https://github.com/richardpenman/whois/blob/master/whois/parser.py but I don't know how I can write this specification :/

Thank :)

Dryusdan avatar Aug 19 '22 12:08 Dryusdan

darn, that's annoying. If someone sends a PR for this I would merge.

richardpenman avatar Dec 07 '22 01:12 richardpenman

It's possible fix this problem? :-)

fundix avatar Aug 05 '23 21:08 fundix

Yes regex parsing likely needs to be updated for the im tld

richardpenman avatar Mar 21 '24 13:03 richardpenman

@fundix @Dryusdan if you want to take a crack at this, it may be as simple as setting dayfirst to True:

class WhoisIm(WhoisEntry):
   dayfirst = True
   ... unmodified past here ...

mzpqnxow avatar Jun 10 '24 16:06 mzpqnxow

I went to fix this and found that it seems to be working right now:

➜ whois dryusdan.im
(lots of redacted stuff, well, redacted)
Domain Details
Expiry Date: 09/12/2024 00:59:56
Name Server:mail.dryusdan.fr.
Name Server:ns1.first-ns.de.
Name Server:robotns3.second-ns.com.
Name Server:robotns2.second-ns.de.
Name Server:mul.dryusdan.fr.
❯ python3
Python 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> whois.whois('dryusdan.im')['expiration_date'].strftime("%Y/%m/%d")
'2024/12/09'

Looks like it's been fixed upstream? I made a branch and set dayfirst, but same result.

BillWeissABK avatar Jun 17 '24 15:06 BillWeissABK

Nice, thanks for checking. Must have been fixed for a separate issue.

richardpenman avatar Jun 17 '24 22:06 richardpenman