How to get date out of datetime field?

V

Vapor ..

I have a field in db with datetime format and it contains more than just
simple date. How can I get only date from it?
 
P

Phrogz

I have a field in db with datetime format and it contains more than just
simple date. How can I get only date from it?

What does your format look like?
What database are you using?
How are you connecting Ruby to the database? Are you using
ActiveRecord? Something else?

Do you already have instances of a Ruby Time class? DateTime class?

Do you want an instance of a Date class? Do you just want to visually
display the date only information?

More information required...
 
V

Vapor ..

Gavin said:
What does your format look like?
What database are you using?
How are you connecting Ruby to the database? Are you using
ActiveRecord? Something else?

Do you already have instances of a Ruby Time class? DateTime class?

Do you want an instance of a Date class? Do you just want to visually
display the date only information?

More information required...

oh well

I am using MySQL and when I look into it, it shows something like
'2007-12-10 18:58:17' like this.

And I am using all the default settings (ActiveRecord and stuff)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top