Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AFNIC parsers date format #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

itghlu
Copy link

@itghlu itghlu commented Apr 12, 2019

Fix date parsing in AFNIC parsers as the format had changed from DD/MM/YYYY to YYYY-MM-DDThh:mm:ssZ (ISO 8601).

The parse_time method can handle this date format without pre-processing.

Original code would result in negative dates:

#!/usr/bin/env ruby

require 'bundler/setup'
require 'whois'
require 'whois-parser'

parser = Whois.lookup('1c2.fr').parser

2.3.1 :008 > parser.created_on
 => -2004-05-20 11:28:40 UTC
2.3.1 :009 > parser.updated_on
 => -2018-04-08 03:52:04 UTC
2.3.1 :010 > parser.expires_on
 => -2019-05-07 07:43:45 UTC

Fix date parsing in AFNIC parsers as the format had changed from
DD/MM/YYYY to YYYY-MM-DDThh:mm:ssZ.
@itghlu itghlu force-pushed the fix-afnic-whois-format branch from 82b7b90 to ca20fda Compare July 2, 2019 21:49
@jarthod
Copy link

jarthod commented Nov 9, 2021

I've hit this problem too, thanks for the fix @itghlu 🙇
For the record I merged this into my fork: jarthod/whois-parser which is going to include many other updates so we can benefit from a more up-to-date version without cherry-picking everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants