Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ordinal Date String to Standard Date String for a Beginner

Reply
Thread Tools

Ordinal Date String to Standard Date String for a Beginner

 
 
davyb
Guest
Posts: n/a
 
      11-18-2005
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

 
Reply With Quote
 
 
 
 
Todd
Guest
Posts: n/a
 
      11-18-2005
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

 
Reply With Quote
 
 
 
 
J. Merrill
Guest
Posts: n/a
 
      11-18-2005
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!!


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


 
Reply With Quote
 
Austin Ziegler
Guest
Posts: n/a
 
      11-18-2005
On 11/18/05, J. Merrill <(E-Mail Removed)> 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
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed)
* Alternate: (E-Mail Removed)


 
Reply With Quote
 
Gregory Brown
Guest
Posts: n/a
 
      11-18-2005
On 11/18/05, Austin Ziegler <(E-Mail Removed)> 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.


 
Reply With Quote
 
Ryan Leavengood
Guest
Posts: n/a
 
      11-18-2005
On 11/18/05, Gregory Brown <(E-Mail Removed)> 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


 
Reply With Quote
 
Martin DeMello
Guest
Posts: n/a
 
      11-18-2005
Ryan Leavengood <(E-Mail Removed)> wrote:
> On 11/18/05, Gregory Brown <(E-Mail Removed)> 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
 
Reply With Quote
 
Gregory Brown
Guest
Posts: n/a
 
      11-18-2005
On 11/18/05, Martin DeMello <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java 5.0 Enum: why not valueOf(int ordinal)? diegomrosa Java 6 11-19-2005 12:09 PM
Is there a way to get a column by name instead of ordinal? needin4mation@gmail.com ASP .Net 4 08-02-2005 08:36 PM
Internationalization of ordinal numbers Chris Smith Java 1 05-16-2005 03:52 AM
Determing the ordinal position of items in ListBox SamIAm ASP .Net 1 09-29-2003 07:16 AM
Re: Ordinal Expression from String Ion Chalmers Freeman Java 0 07-27-2003 07:40 PM



Advertisments