Question regarding date time

Shihtzu

Member
Joined
Nov 24, 2006
Messages
16
Programming Experience
Beginner
I understand

date.today will give me the date

how do I get what day is it? Example Tuesday or so for today date?

my database has a date value in there, may I know how do I compare the value of date.today along with the value after executing the sql command to extract the data. say I put the extracted date from sql into a variable called datefound.

is it
if datefound = date.today
 
Thanks, that help was useful.

I know about

Date.Today.AddDays(1) means add 1 days to the current date

but how do i subtract 1 day from the current date?
 
may I know how do I compare the value of date.today along with the value after executing the sql command to extract the data. say I put the extracted date from sql into a variable called datefound.

is it
if datefound = date.today


yes. dates can be equated, but re,ember that a date that is 1 minute paste midnight is not the same as a date that is 2 minutes past midnight.

even if the dates vary by 1 millisecond, they are different

dates can be subtracted from other dates which results in a TimeSpan object - this can be queried for the number of hours minutes seconds etc between the 2 dates

Press F2 in the IDE, and type "DateTime" and read about the DateTime construct
Also read about TimeSPan
 
Back
Top