473,834 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert the email date in header to the date of vb.net?

yxq
Hello,

I found there are some date formats in the email header,

for example:
Fri, 23 Sep 2005 08:51:56 +0800
Sat, 17 Sep 2005 09:08:07
Wed Oct 19 13:40:23 2005
19 Oct 2005 13:40:23 +0000
19 Oct 2005 13:40:23 -0400

How to convert these date formats to VB.NET date? Thank you!
Nov 21 '05 #1
2 4955
Hello,

AFAIK, you'll have to use custom date & time format strings and
Date.ParseExact method for this, e.g. for first item in your list:

~
Dim dt As Date = Date.ParseExact ("Fri, 23 Sep 2005 08:51:56 +0800",
"ddd, dd MMM yyyy hh:mm:ss zzzz",
Globalization.D ateTimeFormatIn fo.InvariantInf o)
~

See this for more info:

"Custom DateTime Format Strings"
http://msdn.microsoft.com/library/en...CustomDateTime
FormatStrings.a sp

Roman
"yxq" <ga***@163.ne t> / :
news:um******** ******@TK2MSFTN GP10.phx.gbl...
Hello,

I found there are some date formats in the email header,

for example:
Fri, 23 Sep 2005 08:51:56 +0800
Sat, 17 Sep 2005 09:08:07
Wed Oct 19 13:40:23 2005
19 Oct 2005 13:40:23 +0000
19 Oct 2005 13:40:23 -0400

How to convert these date formats to VB.NET date? Thank you!

Nov 21 '05 #2
yxq
I found a websit to convert email date format, can anyone convert to vb.net?
thank you!
http://search.cpan.org/~cwest/Email-.../Email/Date.pm

*************** *************** *************** ****
sub format_date {
my $time = shift || time;
my ($sec, $min, $hour, $mday, $mon, $year, $wday) = (localtime
$time)[0..6];
my $day = (qw[Sun Mon Tue Wed Thu Fri Sat])[$wday];
my $month = (qw[Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec])[$mon];
$year += 1900;

my $diff = Time::Local::ti megm(localtime $time)
- Time::Local::ti megm(gmtime $time);
my $direc = $diff < 0 ? '-' : '+';
$diff = abs $diff;
my $tz_hr = int( $diff / 3600 );
my $tz_mi = int( $diff / 60 - $tz_hr * 60 );

sprintf "%s, %d %s %d %02d:%02d:%02d %s%02d%02d",
$day, $mday, $month, $year, $hour, $min, $sec, $direc, $tz_hr, $tz_mi;

}

"yxq" <ga***@163.ne t> дϢ:um **************@ TK2MSFTNGP10.ph x.gbl...
Hello,

I found there are some date formats in the email header,

for example:
Fri, 23 Sep 2005 08:51:56 +0800
Sat, 17 Sep 2005 09:08:07
Wed Oct 19 13:40:23 2005
19 Oct 2005 13:40:23 +0000
19 Oct 2005 13:40:23 -0400

How to convert these date formats to VB.NET date? Thank you!

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2234
by: Piotr Pietrowski | last post by:
Hello everybody, I have a *big* problem. I thought its not that big problem for you professionals... Anyway, I have a begin date which has 3 dropdown boxes (day/Month/Year). The same for the end date. So if somebody selects the begin date 13.12.2004 and the end date 19.12.2004
6
4226
by: Mike Koerner | last post by:
Hi, I am having problems setting the HttpWebRequest Date header. I understand that it is a restricted header and I do receive the "This header must be modified with the appropriate property." Is there a way to make sure that the date header is sent over or a way to work around this exception? Here's a sample of the code:
2
3921
by: Drum2001 | last post by:
Hello, I am having isues with the following: I have two forms, a MAIN FORM with a SUB FORM: Within the MAIN FORM, I have an unbound textbox (Date Format) and a command button. Onload, the textbox defualts to Date(). The SUB FORM has a bound textbox (Date Format). I am trying to create the code for the command button to compare the
2
16815
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a recognizable date format, I've done the following: Query 1: References Source Table; Isolates Year, Day; creates MMDD field Acc Open Year: Left(,4) Acc Open Day: Right(,2) MMDD: Right(,4) Query 2: References Query 1; Isolates Month
0
1400
by: payelit21 | last post by:
Hi Friends, can any body help me to convert excel cell from date to general and passinfg value to min value and max value of axis in chart through VB. Thanks Payel
7
8469
by: itsmesrini85 | last post by:
HI i have a string "sdate" which has a date in the format "dd-MMM-yyyy" i have to convert it into sql date format for further querying.... plz help. TIA SRI
4
2271
by: shapper | last post by:
Hello, I have created a GridView on runtime by implementing the ITemplate class. This Gridview displays a list of articles. Each article has a Title, Content and PubDate. I am trying to create a Date Header like in a blog, i.e., display the date on top of every daily posts.
1
2256
by: hiteshrane | last post by:
Can anybody tell me how to convert milisecond back to date format, the date is converted to milisecond by using mktime function.
1
9796
by: smdmca | last post by:
I have Julian date, I want to convert it into date. Is there any function in MySql to convert Julian date to date eg- Julian Date- 2455116 Date - Oct - 12, 2009
1
5096
by: Akinyemi | last post by:
Hi, I started learning Java a year ago. Before then I had written a Visual Basic Program that maintains student information. I now want to write the same program in Java. But I do not know how to convert user input to Date. For example the user will have to type in the student's birthDate, yearOfGraduation, etc? I have read some tutorials but couldn't figure out anything as there were no relevant examples. Suppose a user types 2/9/ 2006,...
0
9800
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9651
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9339
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5800
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3085
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.