Im writing an small code and I need to add tomorrow's date on it. The format should be YYYY-MM-DD and I already tried " DateAdd("d",1,d_now) and it returns MM-DD-YYYY. How can I format this to YYYY-MM-DD ?
format is not enough....
'format a number with the correct amount of digits
eg: 9 becomes 09 but 11 stays 11'
Function formatNumber(value, digits)
if digits > len(value) then
formatNumber = String(digits-len(value),"0") & value
else
formatNumber = value
end if
End Function
'write the date "manually"'
response.write Year(date) & "-" & _
formatNumber(Month(date),2) & _
"-" & formatNumber(Day(date),2)
Take a look at this post - it might help you out... How to transform a date-string in classic asp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With