Am 12.11.2012 16:35, schrieb Hassan Schroeder:
> On Mon, Nov 12, 2012 at 7:08 AM,  <sto.mar / web.de> wrote:
>
>>>>> t1=Time::parse(current_date+' '+current_time)
>>>
>>> I think that should be DateTime::parse, but ...
>>
>> The OP was using Time.parse from the `Time' library.
>
> Really?
>
> 1.9.3 (main):0 > Time.parse(remote_date+' '+remote_time)
> NoMethodError: undefined method `parse' for Time:Class

Please reread the thread.
The OP used require 'time', exactly as I stated.

>>>> Simply use `t1 = Time.new', which returns the current system time.
>
>> But for the considered example, Time.parse returns local time,
>> since no time zone was specified in the argument, so it should work.
>
> No, it doesn't, and no, it won't.

Yes, it does, and yes, it will.

$ ri Time.parse
[...]

If the extracted timezone abbreviation does not match any of them, it
is ignored and the given time is regarded as a local time.

[...]

> 1.9.3 (main):0 > t1 = DateTime.parse("2012-11-12 07:30")
[...]

I was explicitly *not* talking about DateTime.parse!


-- 
<https://github.com/stomar/>