Seth:
Try with this:
Dim dNow As DateTime = DateTime.Now
Dim NewDate As DateTime
NewDate = dNow.AddMonths(-2)
NewDate = NewDate.AddDays((NewDate.Day - 1) * -1)
Gustavo A. Cantero
CEO - Scientia® Soluciones Informáticas
MCP - MCSD - MCTS
http://www.scientia.com.ar http://www.programandoamedianoche.com http://foro.scientia.com.ar
-----Mensaje original-----
De: Seth Williams [mailto:sm@here.com]
Expuesto a las: Martes, 07 de Octubre de 2008 04:48 p.m.
Expuesto en: microsoft.public.dotnet.framework.aspnet
Conversación: Get Date and format to 1st Day of month
Asunto: Get Date and format to 1st Day of month
I need to fill a textbox with a date that, based on the current day, is
2
months back - PLUS I need it to reflect the first day of the month
so - I've got :
Dim dNow As DateTime = DateTime.Now.ToShortDateString
Dim NewDate As DateTime
NewDate = dNow.AddMonths(-2)
How do I make it so that the day portion of NewDate is always 1?