Now i facing the date format in my
database. I am using mysql as my database then the datetime format is
2008-06-04 15:17:55. But my datetime format is like this Fri May 23
16:43:28 +0800 2008. So when i execute it say incorrect datetime value.
how do i change the date_format in rails.
I did not save in any variable like @email_date_time so i cannot do
DateTime.parse(@email_date_time)
Because the datetime is i retrieved from
internet email and save it into a text file. So there isn't any variable
assign to it.
Fri May 23 16:43:28 +0800 2008 is a rfc822 format.
So how can i change mysql date format to rfc822 date_format in rails.
I do some coding in rails like these:
datetime = ""
msisdn = ""
File.open(Pathname.new(ARGV[0]), 'r') do |mbox|
RMail::Mailbox.parse_mbox(mbox) do |raw|
count += 1
print "Mail #{count}\n"
message = RMail::Parser.read(raw)