Connecting Tech Pros Worldwide Forums | Help | Site Map

day month year

joe
Guest
 
Posts: n/a
#1: Apr 8 '06
how to get the
day if 1-9 then 01-09 else 11-31
month if 1-9 then 01-09 else 10-12
year 01-99
Phillip Williams
Guest
 
Posts: n/a
#2: Apr 8 '06

re: day month year


Response.Write (DateTime.Now.ToString("MM"));
Response.Write (DateTime.Now.ToString("yy"));
Response.Write (DateTime.Now.ToString("dd"));
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"joe" wrote:
[color=blue]
> how to get the
> day if 1-9 then 01-09 else 11-31
> month if 1-9 then 01-09 else 10-12
> year 01-99[/color]
Teemu Keiski
Guest
 
Posts: n/a
#3: Apr 8 '06

re: day month year


E.g with string formatting. More information about it:

Formatting Types
http://msdn2.microsoft.com/en-us/lib...9x(VS.80).aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Phillip Williams" <WEBSWAPP@newsgroups.nospam> wrote in message
news:68503DBA-E47C-4330-9C73-7B05B6F99C07@microsoft.com...[color=blue]
> Response.Write (DateTime.Now.ToString("MM"));
> Response.Write (DateTime.Now.ToString("yy"));
> Response.Write (DateTime.Now.ToString("dd"));
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "joe" wrote:
>[color=green]
>> how to get the
>> day if 1-9 then 01-09 else 11-31
>> month if 1-9 then 01-09 else 10-12
>> year 01-99[/color][/color]


Closed Thread