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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758193085, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/modules/Common/Date-Time/index(87): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78