Daniel Finnie wrote:
> I would create a time object and then format it how you like.
> 
> Time.parse(string).strftime(format_string)
> 
> Look up the docs for Time#strftime to determine the format string.


Guys - thanks a lot.
It works just great!!

Here the snipped:
ValidDate = File.open("someFile.txt").readlines.to_s.grep(/Not After/)
#puts 'Certificate is valid ' + ValidDate.to_s
CertValidDate = Time.parse(ValidDate.to_s).strftime("%Y-%d-%m")
#puts CertValidDate

Now I can do my comparison with actualDate and CertValidDAte and I am 
able to create an alarm.

Thanks!!!

bye
Henry
-- 
Posted via http://www.ruby-forum.com/.