Search notes:

VBA: Date and Time related classes/modules

dateTime.vb

Functions and subs

dt_rfc_3339
dt_rfc_3339_sec
dt_iso_8601
firstDayOfMonth
lastDayOfMonth`

Source code

option explicit


function dt_rfc_3339(byVal dt as date) as string ' {
    dt_rfc_3339 = format(dt, "yyyy-mm-dd")
end function ' }

function dt_rfc_3339_sec(byVal dt as date) as string ' {
    dt_rfc_3339_sec = format(dt, "yyyy-mm-dd hh:nn:ss")
end function ' }

function dt_iso_8601(byVal dt as date) as string ' {
    dt_iso_8601 = format(dt, "yyyy-mm-dd\Thh:nn:ss")
end function ' }


function firstDayOfMonth(byVal dt as date) as date ' {
    firstDayOfMonth = dateSerial(year(dt), month(dt), 1)
end function ' }

function lastDayOfMonth(byVal dt as date) as date ' {
    lastDayOfMonth = dateAdd("m", 1, dateAdd("d", -1, firstDayOfMonth(dt)))
end function ' }
Github repository VBAModules, path: /Common/Date-Time/dateTime.vb

See also

timeAccumulator is a VBA class that allows to measure elapsed time to accumulated multiple measurements.
The parsePossibleDate() function in Text.bas.
Date and time related VBA functions
René's VBA Modules

Index