PC Review


Reply
Thread Tools Rate Thread

different datetime format on the same web server

 
 
Ya Ya
Guest
Posts: n/a
 
      14th Nov 2004
I have developed a class library for a web application of mine.

When compiling the code of the class library on one development machine and
copy DLL to my web server I get dd/mm/yyyy date format when using the Now()
function.

When compiling the same code on another machine and copy the DLL to the same
web server I get mm/dd/yyyy date format.

I have not change the web.config of the application on the web server (I
only replace the DLL).

How is that possible?

Can someone help here?



Thanks

(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Nov 2004
"Ya Ya" <(E-Mail Removed)> schrieb:
> I have developed a class library for a web application of mine.
>
> When compiling the code of the class library on one development machine

and
> copy DLL to my web server I get dd/mm/yyyy date format when using the

Now()
> function.
>
> When compiling the same code on another machine and copy the DLL to the

same
> web server I get mm/dd/yyyy date format.
>
> I have not change the web.config of the application on the web server (I
> only replace the DLL).


How do you convert the date to a string? Are you sure the currently
executing thread's 'CurrentCulture' is the same?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 
Reply With Quote
 
Jim M
Guest
Posts: n/a
 
      14th Nov 2004
Look in the control panel under regional and language options or Regional
settings. Make sure the date format is the same on both servers. You can
also set this in your code to ensure you always get the format you want.
Although this uses a page_load you should probably use this in global.asax

imports system.globalization

Sub Page_Load(byval sender as object, e as eventargs)

With System.Threading.Thread.CurrentThread
Dim ci As New System.Globalization.CultureInfo("en-US")
Dim dtf As DateTimeFormatInfo = New
System.Globalization.DateTimeFormatInfo
dtf.ShortDatePattern = "MM.dd.yyyy"
ci.DateTimeFormat = dtf
.CurrentCulture = ci
Response.Write(Now.ToShortDateString)
End With

End sub


"Ya Ya" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have developed a class library for a web application of mine.
>
> When compiling the code of the class library on one development machine
> and copy DLL to my web server I get dd/mm/yyyy date format when using the
> Now() function.
>
> When compiling the same code on another machine and copy the DLL to the
> same web server I get mm/dd/yyyy date format.
>
> I have not change the web.config of the application on the web server (I
> only replace the DLL).
>
> How is that possible?
>
> Can someone help here?
>
>
>
> Thanks
>
> (E-Mail Removed)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DateTime.Now() to SQL Server(tm) standard internal format fordatetime huohaodian@gmail.com Microsoft Dot NET 3 7th Feb 2008 12:44 AM
Convert DateTime.Now() to SQL Server(tm) standard internal format fordatetime huohaodian@gmail.com Microsoft C# .NET 4 6th Feb 2008 07:33 PM
Correctly format a string for comparison against a datetime column in MS SQL Server rhaazy Microsoft C# .NET 2 3rd Aug 2007 09:40 PM
different datetime format on the same web server Ya Ya Microsoft Dot NET Framework 2 14th Nov 2004 10:11 PM
different datetime format on the same web server Ya Ya Microsoft ASP .NET 2 14th Nov 2004 10:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:03 PM.