473,385 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Datetime parsing

I have some dates in a file that I need to read as strings in the
format eg '8.Aug.06' and then convert to a .Net date type. The date is
also available as day of the year, ie an integer.

Does VB.Net 2.0 have any direct method to turn a month abbreviated as
mmm into its numeric equivalent or alternatively a method using DOY?
There are obviously methods for the reverse process given a .Net date,
but I can't spot anything direct from which to build a date value.

JGD
Aug 7 '06 #1
1 1176
John,

With the DateTime.parseExact you can mostly do everything.

http://msdn2.microsoft.com/en-us/library/w2sa9yss.aspx

Be also aware that it is not possible to create a DateTimeFormatInfo for a
neutral culture.
http://msdn2.microsoft.com/en-us/lib...ormatinfo.aspx

If the date is conform any standard British format and your computer is
localised as that you can mostly use the CDate as well, which is less
restrictive.

http://msdn2.microsoft.com/en-us/library/2dt118h2.aspx

I hope this helps,

Cor

"John Dann" <ne**@prodata.co.ukschreef in bericht
news:jr********************************@4ax.com...
>I have some dates in a file that I need to read as strings in the
format eg '8.Aug.06' and then convert to a .Net date type. The date is
also available as day of the year, ie an integer.

Does VB.Net 2.0 have any direct method to turn a month abbreviated as
mmm into its numeric equivalent or alternatively a method using DOY?
There are obviously methods for the reverse process given a .Net date,
but I can't spot anything direct from which to build a date value.

JGD

Aug 7 '06 #2

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

Similar topics

5
by: Gerrit Holl | last post by:
Hi, it seems the datetime library does not have a .strptime class method. If I want to create a datetime object from a string, I currently have to do: datetime.date(*time.strptime(s,...
0
by: F. GEIGER | last post by:
py2exe and datetime -> No module named datetime I've begun to use the stdlib module datetime instead of my home brewn classes. Since then a py2exe app doesn't run anymore: Traceback (most...
2
by: Simon | last post by:
Hi all If I have a method for inserting data to database and it take a parameter dateTime in String. Since C# does not have a function to test date like IsDate in VB.Net. Would it be a good idea...
15
by: Dan S | last post by:
My application asks the user to enter in a date - in the mm/dd/yyyy format. Is there any quick and easy way to verify the date the user enters is formatted correctly? Right now I'm calling...
2
by: Sterling Ledet | last post by:
I am trying to create a web service that takes a string from my web server in the following format: Mon, 6 Oct 2003 18:39:47 UTC and put's in a datetime so it can then be reformatted in C# as...
6
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
4
by: Michael Meckelein | last post by:
Hello, Wondering, if C# (framework 2.0) does not support parsing DateTime timezones in three letter acronyms. I would like to parse date strings like "2005 Nov 01 11:58:47.490 CST -6:00" but...
6
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm just trying to test datetime functions: DateTime dt1 = "9/15/2007"; DateTime dt2 = "9/17/2007"; DateTime dtResult; dtResult = dt2 - dt1; The above is what i'm trying to say...
7
by: Daniel Fetchinson | last post by:
Many times a more user friendly date format is convenient than the pure date and time. For example for a date that is yesterday I would like to see "yesterday" instead of the date itself. And for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.