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


Groups > comp.lang.ruby > #7290

Re: how do i convert this comma delimited string to date object?

From jacki <collector@idealan.pl>
Newsgroups comp.lang.ruby
Subject Re: how do i convert this comma delimited string to date object?
Date 2016-09-06 09:12 +0200
Organization ATMAN - ATM S.A.
Message-ID <842de034-91a2-a93a-029f-306d9f50461a@idealan.pl> (permalink)
References <ebcafee9-f008-4196-bdac-981ba31d4229@googlegroups.com>

Show all headers | View raw


W dniu 2016-09-02 o 18:48, Junkone pisze:
> I have a string with date and time that are comma delimited in this format. how do I convert it to date object?
> 2013-10-02, 4:30am
> 

2.2.0 :008 > require 'time'
 => true
2.2.0 :012 > Date.parse('2013-10-02, 4:30am')
 => #<Date: 2013-10-02 ((2456568j,0s,0n),+0s,2299161j)>

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


Thread

how do i convert this comma delimited string to date object? Junkone <junkone1@gmail.com> - 2016-09-02 09:48 -0700
  Re: how do i convert this comma delimited string to date object? Hasan Diwan <hdiwan@gmail.com> - 2016-09-02 18:19 +0000
  Re: how do i convert this comma delimited string to date object? jacki <collector@idealan.pl> - 2016-09-06 09:12 +0200
  Re: how do i convert this comma delimited string to date object? pratap477@gmail.com - 2016-10-21 03:08 -0700

csiph-web