# Wednesday, 28 April 2004

I am sometimes amazed at the lengths people are willing to go to get the job done. Take for example the simple task of getting a date from an input field. Some months ago I was working on a site which the original contractor wasn't able to get done alone so I got to take a peek at how the big businesses do their coding.

One of the things I found was how little the previous coders knew of the .NET platform - it was really obvious that these particular coders had lots of experience with ASP 3.0 but not much with ASP.NET. An example of this was when they needed to pull a date from a textbox - they accomplished this by doing two things: First assuming that the string entered would be formatted in a particular way and second by iterating through the string picking up month, day, and year parts of the date.

I did a little scounting around the SDK docs and found a much nicer way of doing this:

Dim formatInfo As New DateTimeFormatInfo()
Dim myDate As Date
formatInfo.ShortDatePattern = "dd-MM-yyyy"
myDate = Convert.ToDateTime(myDateTextBox.Text, formatInfo)

I am certainly no .NET god so as I am writing this I am wondering how much cool stuff I am missing in the .NET framework simply because I don't know enough about it?

Saturday, 01 May 2004 21:16:04 (Romance Daylight Time, UTC+02:00)
Thats the great part of being a .NET developer - every day you learn something new :)
Comments are closed.