2010-08-24 5 views

Répondre

0

j'ai pu obtenir DateTime pour analyser votre chaîne après l'ablation du côlon entre l'année et l'heure:

# given apache_time = "[13/Aug/2008:00:50:49 -0700]" 
stamp = apache_time.sub %r[(/\d{4}):(\d{2})], '\1 \2' 
datetime = DateTime.parse stamp # returns DateTime representing "2008-08-13T00:50:49-07:00" 
Questions connexes