dt = dateSerial(yr, mn, dy) dt = dateValue("August 28, 1970") timeSerial(hr, mi, ss) option explicit
sub main() ' {
dim dt as date
dt = now()
debug.print "First day of month is: " & first_of_month(dt)
debug.print "Last day of month is: " & last_of_month(dt)
end sub ' }
function first_of_month(dt as date) as date ' {
first_of_month = dateSerial(year(dt), month(dt), 1)
end function ' }
function last_of_month(dt as date) as date ' {
last_of_month = dateAdd("m", 1, dateAdd("d", -1, first_of_month(dt)))
end function ' }