[thelist] ASP: getting double digits

Aylard James J jaylard at equilon.com
Thu, 20 Jan 2000 15:57:20 -0600


Tab,

	Take each individual part of your date, as appropriate, and
concatenate a "0" in front of any single-digit values -- something like:

If x < 10 Then
  x = "0" & x
End If

	Then put it all together.

hth,
James Aylard
Equilon Enterprises LLC
jaylard@equilon.com


> -----Original Message-----
> From: Tab Alleman [mailto:talleman@avweb.com]
> Sent: January 20, 2000 1:48 PM
> To: thelist@lists.evolt.org
> Subject: [thelist] ASP: getting double digits
> 
> 
> I have an ASP script that needs to create a Date-Time string 
> like this:
> 
> YYYYMMDDhhmmss
> 
> I'm using Year() Month() etc, to get the data, and then 
> concatenating them
> all into one string, but the problem is that whenever the 
> day, month, hour,
> etc is a single digit, those functions always return single 
> digit values.
> 
> So for instance, if Now() is 01/19/00 15:00:00, how can I 
> turn that into a
> string like this:
> 
> 20000119150000
> 
> instead of like this:
> 
> 20001191500
> 
> ?