Datas em ASP.Net (VB)

logo asp.net
Dim dtNow As DateTime = DateTime.Now

litNow.Text = dtNow.ToString -> 12/29/2006 7:51:11 AM
litDate.Text = dtNow.Date -> 12/29/2006
litToday.Text = dtNow.Today -> 12/29/2006
litToShortDateString.Text = dtNow.ToShortDateString -> 12/29/2006
litToShortTimeString.Text = dtNow.ToShortTimeString -> 7:51 AM
litToLongDateString.Text = dtNow.ToLongDateString -> Friday, December 29, 2006
litToLongTimeString.Text = dtNow.ToLongTimeString -> 7:51:11 AM
litToUniversalTime.Text = dtNow.ToUniversalTime -> 12/29/2006 12:51:11 PM
litDayOfYear.Text = dtNow.DayOfYear -> 363
litDayOfWeek.Text = dtNow.DayOfWeek -> 5
litDay.Text = dtNow.Month -> 12
litDay.Text = dtNow.Day -> 29
litDay.Text = dtNow.Year -> 2006
litAddDays.Text = dtNow.AddDays(1) -> 12/30/2006 7:51:11 AM
litAddHours.Text = dtNow.AddHours(1) -> 12/29/2006 8:51:11 AM
litAddMilliseconds.Text = dtNow.AddMilliseconds(10000) -> 12/29/2006 7:51:21 AM
itAddMinutes.Text = dtNow.AddMinutes(1) -> 12/29/2006 7:52:11 AM
litAddMonths.Text = dtNow.AddMonths(1) -> 1/29/2007 7:51:11 AM
litAddSeconds.Text = dtNow.AddSeconds(1) -> 12/29/2006 7:51:12 AM
litAddTicks.Text = dtNow.AddTicks(1000000000000) -> 12/30/2006 11:37:51 AM
litAddYears.Text = dtNow.AddYears(1) -> 12/29/2007 7:51:11 AM
litAddNegDays.Text = dtNow.AddDays(-1) -> 12/28/2006 7:51:11 AM
litAddNegYears.Text = dtNow.AddYears(-1)Â ->Â 12/29/2005 7:51:11 AM

Deixe um comentário

O seu endereço de email não será publicado. Campos obrigatórios marcados com *