Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Date/Time

Reply
Thread Tools

Date/Time

 
 
shapper
Guest
Posts: n/a
 
      09-29-2006
Hello,

How can I get a Date/Time string in Asp.Net 2.0 as follows:

"Tue, 10 Jun 2003 09:41:01 GMT"

And I need to have it according to specified culture.


Thanks,

Miguel

 
Reply With Quote
 
 
 
 
Chris Fulstow
Guest
Posts: n/a
 
      09-29-2006

Try something like this:

DateTime d = DateTime.Now;
Console.WriteLine(d.ToString("R",
System.Threading.Thread.CurrentThread.CurrentCultu re));

Substitute CurrentCulture for your required CultureInfo object.

shapper wrote:

> Hello,
>
> How can I get a Date/Time string in Asp.Net 2.0 as follows:
>
> "Tue, 10 Jun 2003 09:41:01 GMT"
>
> And I need to have it according to specified culture.
>
>
> Thanks,
>
> Miguel


 
Reply With Quote
 
 
 
 
Matthias Pieroth
Guest
Posts: n/a
 
      09-29-2006
Hi,

use d.ToString("R" and CultureInfo or ParseExact:

http://www.codegod.de/WebAppCodeGod/Main.aspx?pid=129

Bye,

--
Matthias Pieroth
www.codegod.de - The Page for .NET-developers

"shapper" <> wrote in message
news: oups.com...
> Hello,
>
> How can I get a Date/Time string in Asp.Net 2.0 as follows:
>
> "Tue, 10 Jun 2003 09:41:01 GMT"
>
> And I need to have it according to specified culture.
>
>
> Thanks,
>
> Miguel
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57