[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TZ bug in Date and DateTime.strftime formatter?

Jonathan

4/10/2007 2:22:00 PM

> !#$%#$@ (As they used to say in the comic books, not realizing that they
were coding in perl)
Really? I thought it was a Ruby golf solution.

As a newcomer to this list I'm dismayed by the constant anti-Perl snipes.
TBH its really putting me off getting involved with Ruby at all.

Incidently, I also subscribe to a couple of Python lists where there isn't
any of this BS.


So what is it CPAN envy?


"Ruby inherited the Perl philosophy of having more than one way to do
the same thing. I inherited that philosophy from Larry Wall,
who is my hero actually. I want to make Ruby users free.
I want to give them the freedom to choose."

Yukihiro Matsumoto



-----Original Message-----
From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf Of
Rover Rhubarb
Sent: 10 April 2007 15:01
To: ruby-talk@ruby-lang.org
Subject: Re: TZ bug in Date and DateTime.strftime formatter?

The plot thickens.

Playing around with DateTime I thought I had it. DateTime.now.zone seems to
give the right result. So I went back to my test cases. Look at this:

irb(main):008:0> dt_summer = DateTime.parse("1 August 2006 15:25") =>
#<DateTime: 706737353/288,0,2299161> irb(main):009:0> dt_winter =
DateTime.parse("1 November 2006 15:25") => #<DateTime:
706763849/288,0,2299161> irb(main):010:0> dt_summer.zone => "Z"
irb(main):011:0> dt_winter.zone
=> "Z"
irb(main):012:0> dt = DateTime.now
=> #<DateTime: 212042973457327/86400000,1/24,2299161>
irb(main):013:0> dt.zone
=> "+0100"


So the zone for a parsed DateTime is 'Z' but for 'now' is correct at '+0100'

!#$%#$@ (As they used to say in the comic books, not realizing that they
were coding in perl)

--
Posted via http://www.ruby-....

***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority

This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:
www.rbs.com
www.rbsgc.com
www.rbsmarkets.com
***********************************************************************************

1 Answer

John Joyce

4/10/2007 3:56:00 PM

0


On Apr 10, 2007, at 11:21 PM, HOPKINSON, Jonathan, GBM wrote:

>> !#$%#$@ (As they used to say in the comic books, not realizing
>> that they
> were coding in perl)
> Really? I thought it was a Ruby golf solution.
>
> As a newcomer to this list I'm dismayed by the constant anti-Perl
> snipes.
> TBH its really putting me off getting involved with Ruby at all.
>
> Incidently, I also subscribe to a couple of Python lists where
> there isn't
> any of this BS.
>
>
> So what is it CPAN envy?
>
>
> "Ruby inherited the Perl philosophy of having more than one way to do
> the same thing. I inherited that philosophy from Larry Wall,
> who is my hero actually. I want to make Ruby users free.
> I want to give them the freedom to choose."
>
> Yukihiro Matsumoto
>
> !#$%#$@ (As they used to say in the comic books, not realizing
> that they
> were coding in perl)

Why the thin skin? It's a joke about the way Perl code often appears.
It's not literally true and not a personal attack on Perl users. On
the contrary, quite a few Ruby users all have lots of experience with
Perl and there is no hate towards Perl. I bet a lot of folks around
here still use Perl. I don't but I still like Perl! At times pieces
of Perl code can be pretty dense. This is true of most languages