HELP!! Win 2003 datetime format

G

Guest

Hello -

I had originally posted this question and was told the problem was caused by
a setting on the host and could not be changed there. I called the host to
see if they knew how I can solve my problem and they didn't have a clue.
They are running Windows Server 2003.

I have datagrids that display date and time from Sql Server 2000. In Sql
Server it's derived from GetDate(). The date comes out okay. It's the time
I'm having a problem with. I want a simple time, e.g., 6:05 AM

I've tried displaying it as:
<%# DataBinder.Eval(Container.DataItem, "ReplyDT", "{0:t}") %>
That produces a military time on their machine. On mine, it comes out all
right. I'm running XP Pro.

I then tried to be specific:
<%# DataBinder.Eval(Container.DataItem, "ReplyDT", "{0:h:mm:ss tt}") %>
That comes out fine on my machine and on the web it shows up with the
correct time, but followed by some strange "T"-type character followed by
somewhat of a strange "4" (sort of) character in the place of the AM or PM.

I then tried just plain "g" to see what would happen. That gave me military
time again.

I'm wondering if a look at the Regional Settings in Windows 2003 Server
might reveal some other values I could try. I do not currently have W2003
installed.

Any help with this would be greatly appreciated!! I can't believe there's
no way around this.
 
G

Guest

I am answering this question myself in case anyone else runs into this
problem. Dave from my service provider finally was the one who solved it.

I did not realize my host was international. I therefore had to put
culture='en-US'
at the top of the page directive in my html page. It now functions perfectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top