Try ParseDate:
model.time = Time.mktime(ParseDate.parsedate(""2005:10:04
06:31:31"))
Vish
On 10/1/06, Nasir Khan
<rubylearner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> The get_exif_by_number() method returns the date in a format different
> from can be parsed by default rails string_to_date or parse() method.
>
> Is there a helper that is readily available for this? -
>
> # Load the file
> >> m_file = ImageList.new("DSC02465.JPG")
> => [DSC02465.JPG JPEG 1219x914 1219x914+0+0 DirectClass 8-bit 490kb]
> scene=0
>
> # Get the datetime when the picture was taken
> >> m_file.get_exif_by_number(36867)[36867]
> => "2005:10:04 06:31:31."
>
> # Load into a table with datetime type by first converting it to Time
> >> ActiveRecord::ConnectionAdapters::Column.string_to_date
> (m_file.get_exif_by_number(36867)[36867])
> => nil
>
> Any suggestions?
>
> Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---