Search notes:

VBA: cDate / cvDate

function cDate (expr as variant) as date
function cvDate(expr as variant) as variant
cDate(dt) and cvDate(dt) are conversion functions: they both convert dt to a date.
The difference between these functions is that cDate returns a date and cvDate returns a variant. Thus, the expression cvDate(null) is valid while cDate(null) raises run-time error 94: Invalid use of Null.
If dt is a numeric type, it is interpreted (cast) as double which represents (fractional) days since midnight 1899-12-30 (See here).
If dt it is a string, it is tried to be interpreted according to the locale currently in effect (which is not always possible).

See also

Other VBA functions

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...', 1758194139, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/functions/conversion/cDate(48): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78