T
Tony B
I'm trying to write a simple vb function that takes a current date and
calculates for the first day of the month of that date what day of the week
it is.
I thought I could take a date object dt, use dt.Days() to return how many
days into the month, then create a date object equal to the 1st of the
month by subtracting the number of days from dt, and then use the dayofweek
method to find out what I need.
My difficulty is how create a date object that is the first day of this
month. The subtract methods need a date object or a timespan object as an
argument, but I cannot see how to set a timespan object to a certain number
of days ?
Am I being stupid here and missing the obvious ?
calculates for the first day of the month of that date what day of the week
it is.
I thought I could take a date object dt, use dt.Days() to return how many
days into the month, then create a date object equal to the 1st of the
month by subtracting the number of days from dt, and then use the dayofweek
method to find out what I need.
My difficulty is how create a date object that is the first day of this
month. The subtract methods need a date object or a timespan object as an
argument, but I cannot see how to set a timespan object to a certain number
of days ?
Am I being stupid here and missing the obvious ?