[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

Re: Date.from_time

From: Daniel Berger <djberg96@...>
Date: 2004-06-13 03:29:17 UTC
List: ruby-core #2979
--- Gavin Sinclair <gsinclair@soyabean.com.au> wrote:
> Folks,
> 
> At the moment, I don't see an easy way to create a
> Date or DateTime
> object given a Time object.  That's something I need
> to do at the
> moment, and it seems like it should be easy.
> 
> If I submit a patch to define Date.from_time, will
> it be accepted?  Is
> there a preferred name?
> 
> Gavin

This is how I used to do it in 1.6.8 but I think there
might be a better way in 1.8.x:

require "date"
require "parsedate"

t = Time.new
d = Date.new(*ParseDate.parsedate(t.to_s)[0..2])

Regards,

Dan


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

In This Thread