I need to parse following String into a DateTime Object:30/Nov/2009:16:29:30 +0100
Is there an easy way to do this?
PS: I want to convert the string above as is. The colon after the year is not a typo. I also want to solve the problem with Ruby and not RoR.
In SQL Server, converting a string to date explicitly can be achieved using CONVERT(). CAST() and PARSE() functions.
format(String) should create an output string in based on the timezone of the current context user. So you should be able to use when data comes in: DateTime dt = DateTime. parse('11/6/2014 12:00 AM');
Shouldn't this also work for Rails?
"30/Nov/2009 16:29:30 +0100".to_datetime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With