pd

Format a number with total number of digits
I used it to format a date as "yyyy-mm-dd"

Function pd(n, totalDigits)
 if totalDigits > len(n) then
  pd = String(totalDigits-len(n),"0") & n
 else
  pd = n
 end if
End Function

' Example
' BBlogDate    = pd(Year(BBlogDate),4) & "-" & pd(Month(BBlogDate),2) & "-" & pd(Day(BBlogDate),2)

n, totalDigits

BBlogDate = pd(Year(BBlogDate),4) & "-" & pd(Month(BBlogDate),2) & "-" & pd(Day(BBlogDate),2)

Views 175 Downloads 85

'format', 'formatdatetime', 'date', 'time', 'digits', 'string', 'zero', 'month', 'year', 'day', 'NotMyWork'

ANmarAmdeen
414
Texts + Strings Classic ASP
Revisions

v1.0