|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datetime parsingI 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 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/library/system.globalization.datetimeformatinfo.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 Show quoteHide quote "John Dann" <n***@prodata.co.uk> schreef in bericht news:jrked29bqgfo40ogotj6sf9gme8m6u9len@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
About Adding controls dynamically
Altering function of keypress for listbox VB6 and ms SQL 2005 DATETIME Getting database fields (rows) to appear as columns in datagrid Convert DAO from VB6 to VB8? Messagebox Issue Variable function activation Cache panels Route planning Cool Interview Questions Link |
|||||||||||||||||||||||