Date / Time format question to finish and deliver web site. Thank You.

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

when i preview an ASP.net web site i am creating to a client Date and Time
show as follow:

Date: dd-mm-yyyy
Time: hh-mm (24 hour clock. Ex: 21:45)

Both Date and Time use 2 digits format. Ex: 02-02-2004 and 02:05

When i preview the web site in the hosting company server the format change
to:

Date: dd-mm-yyyy
Time: hh-mm (12 hour clock. Ex: 9:45 PM)

Both Date and Time loose the 2 digits format. Ex: 2-2-2004 and 2:05 AM

In this web site i use date and time only in 2 situations:
1. Displaying in an ASP.net Time and Date field using:
<%# DateTime.Parse(dbAccess.FieldValue("TimeF",
Container)).ToString("t") %>,
<%# DateTime.Parse(dbAccess.FieldValue("DateF", Container)).ToString("d")
%>
2. Displaying Time in an ASP.net Calendar Control

I looked everywhere and until now i wasn't able to make this work.
It's the only thing i need to solve to deliver the web site to my client.

Can you help me out?

Thank You,
Miguel

P.S: Can you please be as specifique as possible with what i should do so i
don't get lost?
 
Hi Miquel,

Did you look what this can do for you?

ToString("dd MM yyyy")
ToString("HH:mm")

Cor
 
Hi,

i got this answer from somebody else:

"I suspect that those two machines have different culture setting.
You can enforce it in Globalization section of ASPNET configuration file."

Anyway, i also looked sometime ago to what you say.

However until now i wasn't able to make this work.

I really would appreciate that somebody could send me some code solutions to
the examples i sent using ToString or Globalization because somehow i have
not being able to make this work and i am on this for 2 weeks but now the
deliver of this web site is only dependent of this.

Thank You,
Miguel
 
Hi Miguel,

Did you try my answer?

Of course have those 2 machines different globalizations settings however
how would you try to manage the globalizations settings on all your pages
using webforms?

Cor
 
Thanks,

finally i found someone that could answer to this simple question.

Thank You Very Much,
Miguel
 
Back
Top