I have some data that I want to import into a table. The import file has dates in unix_t time format ( seconds since 1970). How would I convert that to either a datetime value or a string? Is that a magic function somewhere? -- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Gregory Seidman
2008-Mar-27 13:19 UTC
Re: Converting unix_t time to something rails understands
On Thu, Mar 27, 2008 at 05:19:24AM -0700, Larry Kelly wrote:> I have some data that I want to import into a table. The import file has > dates in unix_t time format ( seconds since 1970). How would I convert that > to either a datetime value or a string? Is that a magic function somewhere?Time.at seconds_since_epoch> Best Regards, > -Larry--Greg --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Larry Kelly
2008-Mar-27 16:46 UTC
Re: Converting unix_t time to something rails understands
Perfect! Thanks Greg, -Larry On Thu, Mar 27, 2008 at 6:19 AM, Gregory Seidman < gsslist+ror-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote:> > On Thu, Mar 27, 2008 at 05:19:24AM -0700, Larry Kelly wrote: > > I have some data that I want to import into a table. The import file > has > > dates in unix_t time format ( seconds since 1970). How would I convert > that > > to either a datetime value or a string? Is that a magic function > somewhere? > > Time.at seconds_since_epoch > > > Best Regards, > > -Larry > --Greg > > > > >-- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---