Forum: Ruby Ordinal Date String to Standard Date String for a Beginner

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9eea9a25e1135b40abecdd695815dca8?d=identicon&s=25 david.a.boyd (Guest)
on 2005-11-18 04:44
(Received via mailing list)
Hi,

I have an ordinal date string and I want to change it to an ordinary
date string.  For example: 2005/1 should give January 1, 2005.  I see
ordinal in the Date class but I need a simple example.  Thanks,

Dave
2cef22e5d84ec3cdc107a5f9f97537e5?d=identicon&s=25 toddkennethbenson (Guest)
on 2005-11-18 06:29
(Received via mailing list)
davyb wrote:
> Hi,
>
> I have an ordinal date string and I want to change it to an ordinary
> date string.  For example: 2005/1 should give January 1, 2005.  I see
> ordinal in the Date class but I need a simple example.  Thanks,
>
> Dave

irb(main):001:0> require 'date'
irb(main):002:0> d = Date.( 2005, 321)
irb(main):003:0> d.to_s
=> '2005-11-17'
irb(main):004:0> d.asctime
=> "Thu Nov 17 00:00:00 2005"
irb(main):005:0> p "#{d.month}/#{d.day}/#{d.year}"
=> "11/17/2005"


There may be other methods/ways/formats, but those are what caught my
attention at first.

Todd
1d6252c8fa730e6b9989db64df35103a?d=identicon&s=25 J. Merrill (j-merrill)
on 2005-11-18 17:50
Somewhat off-topic, but I notice that neither of you have registered.

If you register, when you return to the site the display shows you which
threads include messages that you haven't yet read; and if you go back
to a thread that you've read partially, the display moves directly to
the first message you've not yet seen (but of course you can scroll up
if you need more context).

Registration is extremely painless and the rewards are significant!!
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 halostatue (Guest)
on 2005-11-18 18:32
(Received via mailing list)
On 11/18/05, J. Merrill <jvm_cop@spamcop.net> wrote:
> Somewhat off-topic, but I notice that neither of you have registered.

Actually, it's *extremely* off-topic, as most of us do not read
ruby-talk through the ruby-forum interface, but rather through the
mailing list or the newsgroup.

-austin
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 gregory.t.brown (Guest)
on 2005-11-18 18:59
(Received via mailing list)
On 11/18/05, Austin Ziegler <halostatue@gmail.com> wrote:

> Actually, it's *extremely* off-topic, as most of us do not read
> ruby-talk through the ruby-forum interface, but rather through the
> mailing list or the newsgroup.

I think the ruby-forum is neat but as a minor whine, I don't see why
all the posts from ruby-forum need to be stamped with a "Posted
via..." message.

This gets kinda SPAMmy, in my not at all humble opinion.

I am not against advocating ruby-forum, I just don't see why every
message needs to be tagged with that message.
4b174722d1b1a4bbd9672e1ab50c30a9?d=identicon&s=25 leavengood (Guest)
on 2005-11-18 20:41
(Received via mailing list)
On 11/18/05, Gregory Brown <gregory.t.brown@gmail.com> wrote:
>
> I am not against advocating ruby-forum, I just don't see why every
> message needs to be tagged with that message.

I strongly agree. I would recommend removing the tagline and adding a
new header to indicate the message was posted from Ruby Forum. That
way if someone or something (aka a program) wishes to analyze messages
from Ruby Forum, they can easily and reliably see which messages are
from the forum.

Maybe:

X-Posted-Via: Ruby Forum

Ryan
2cf6d8e639314abd751f83a72e9a2ac5?d=identicon&s=25 martindemello (Guest)
on 2005-11-18 21:24
(Received via mailing list)
Ryan Leavengood <leavengood@gmail.com> wrote:
> On 11/18/05, Gregory Brown <gregory.t.brown@gmail.com> wrote:
> >
> > I am not against advocating ruby-forum, I just don't see why every
> > message needs to be tagged with that message.
>
> I strongly agree. I would recommend removing the tagline and adding a
> new header to indicate the message was posted from Ruby Forum. That
> way if someone or something (aka a program) wishes to analyze messages
> from Ruby Forum, they can easily and reliably see which messages are
> from the forum.

OTOH there's something to be said for leaving it in place at least a
couple of months - it's fairly inoffensive and provides some visibility
for the fledgling forum interface.

martin
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 gregory.t.brown (Guest)
on 2005-11-18 21:57
(Received via mailing list)
On 11/18/05, Martin DeMello <martindemello@yahoo.com> wrote:

> OTOH there's something to be said for leaving it in place at least a
> couple of months - it's fairly inoffensive and provides some visibility
> for the fledgling forum interface.

At the very least it should be an option for registered users to turn on
or off.
It reminds me way too much of "Do you yahoo?"

Besides, if it's useful (which i think it is), there are plenty of
other places to evangelize it and word of mouth will spread as well.
This topic is locked and can not be replied to.