Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

August 7, 2007

Getting date parts from Email Date Header Field in Ruby

Chilkat component properties that have a "Date" data type use the Chilkat::SYSTEMTIME class in Ruby. This snippet of code shows how to get the "Date" header field as a string, and as a SYSTEMTIME which allows the date parts to be accessed as integers:

print email.getHeaderField("date") + "\n";
lTime =
print lTime.wMonth.to_s() + "/" + lTime.wDay.to_s() + "/" + lTime.wYear.to_s() + "\n"
print lTime.wHour.to_s() + ":" + lTime.wMinute.to_s() + ":" + lTime.wSecond.to_s() + "\n"

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.