|
Post by alincon on Oct 21, 2020 20:40:31 GMT -5
I input 063020 to the date$ function and get back 06/30/1920 instead of the expected 06/30/2020. The help file says if the first two digits of the year are omitted, '20' is assumed. Is it me, or is there a bug in the date$ function?
r.m.
|
|
|
Post by tsh73 on Oct 22, 2020 6:33:45 GMT -5
You likely using it wrong
d = date$("06/30/20") print date$(d)
results in 06/30/2020
Same is print date$(date$("06/30/20"))
I tried year from 00 to 99 - got back year from 2000 fo 2099
|
|
|
Post by alincon on Oct 22, 2020 10:20:38 GMT -5
It may be the slashes, but 063019 works without slashes. Years greater than 2019 do not work w/o slashes, seems to me.
r.m.
|
|
|
Post by alincon on Oct 22, 2020 10:50:43 GMT -5
Oops! I had forgotten about this code in my program.
function dat$(d$) if len(d$) < 7 then d$ = mdcySlash$(d$) d = date$(d$) dat$ = str$(d) end function
function mdcySlash$(a$) 'mon day century year mdcySlash$=left$(a$,2) + "/" + mid$(a$,3,2) + "/" + str$(19 + (right$(a$,2) < "20")) + right$(a$,2) end function
|
|