Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2445

Re: convert string to datetime

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.mixmin.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail
From Brian Candler <b.candler@pobox.com>
Newsgroups comp.lang.ruby
Subject Re: convert string to datetime
Date Thu, 7 Apr 2011 05:55:09 -0500
Organization Service de news de lacave.net
Lines 15
Message-ID <6661754cd57dcfdfe89fc5a6aaddb1f9@ruby-forum.com> (permalink)
References <0118058fc84316aaefb7bbfddd395421@ruby-forum.com> <BANLkTik29wYYDpO32O7QCuA0npRXipfDAA@mail.gmail.com>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding Quoted-printable
X-Trace talisker.lacave.net 1302173732 27865 65.111.164.187 (7 Apr 2011 10:55:32 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Thu, 7 Apr 2011 10:55:32 +0000 (UTC)
In-Reply-To <BANLkTik29wYYDpO32O7QCuA0npRXipfDAA@mail.gmail.com>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 381105
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <6661754cd57dcfdfe89fc5a6aaddb1f9@ruby-forum.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:2445

Show key headers only | View raw


"Jesús Gabriel y Galán" <jgabrielygalan@gmail.com> wrote in post 
#991424:
> DateTime#parse:

Or DateTime.strptime, if you want to be explicit about the format.

>> DateTime.strptime("20110309","%Y%m%d")
=> #<DateTime: 4911259/2,0,2299161>

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

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

convert string to datetime Fan Jin <jeff_yq@yahoo.com.au> - 2011-04-07 05:12 -0500
  Re: convert string to datetime Jesús Gabriel y Galán <jgabrielygalan@gmail.com> - 2011-04-07 05:22 -0500
    Re: convert string to datetime Brian Candler <b.candler@pobox.com> - 2011-04-07 05:55 -0500
      Re: convert string to datetime Fan Jin <jeff_yq@yahoo.com.au> - 2011-04-07 20:55 -0500

csiph-web