openSUSE Forums > Network/Internet » DateTime format for web server

Go Back   openSUSE Forums > Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read


Network/Internet Questions about internet applications, network configuration, usage (SAMBA, network printing, NFS)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-May-2009, 15:30
Z_K Z_K is offline
Puzzled Penguin
 
Join Date: Apr 2009
Posts: 19
Z_K hasn't been rated much yet
Default DateTime format for web server

I have put together a simple Apache2 web server on SUSE 11.1 using mono (ASP.NET). I noticed though that when I go to my sample web page that the time format is in military time. How can I configure apache to display in normal US time, that is am and pm.

Reply With Quote
  #2 (permalink)  
Old 07-May-2009, 18:19
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,238
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: DateTime format for web server

This is not an Apache issue, it's your Mono app that displays it. So you should look at your program.
Reply With Quote
  #3 (permalink)  
Old 07-May-2009, 19:27
Z_K Z_K is offline
Puzzled Penguin
 
Join Date: Apr 2009
Posts: 19
Z_K hasn't been rated much yet
Default Re: DateTime format for web server

That does not seem right, it works fine on a Windows 2000 server. I have posted my code below, it is very simple and I got it out of a book.



Code:

<html>
<head>
<title>Testing ASP.NET/C#</title>
<script runat="server" language="C#">
protected void Page_Load(Object s, EventArgs e)
{
lblTime.Text = DateTime.Now.ToString();
}
</script>

</head>
<body>
<h2>Testing ASP.NET and C# on my first ASP.NET web page</h2>

Today's Date:
<asp:Label runat="server" id="lblTime" />
</body>
</html>
Reply With Quote
  #4 (permalink)  
Old 07-May-2009, 19:35
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,238
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: DateTime format for web server

Apache still has nothing to do with it. The app runtime libraries get the time (in seconds from 1/1/1970, no human formatting) from the OS, and translate it to whatever the human needs to see. I'd look at settings for the Mono runtime. It may be related to locale, since obviously the presentation of date depends on the natural language in use in that locale.

Remember that Mono is a .NET workalike, not an exact copy. You may have to tweak some things yourself.
Reply With Quote
  #5 (permalink)  
Old 07-May-2009, 20:47
Z_K Z_K is offline
Puzzled Penguin
 
Join Date: Apr 2009
Posts: 19
Z_K hasn't been rated much yet
Default Re: DateTime format for web server

Oh, okay thanks.

Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

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 On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2