locked
how to set date as "11-Nov-2013" when i publish my project on the server(i know i should do it in iis but i dont know how to set the parameter) RRS feed

  • Question

  • User444096333 posted

    hi

       may i ask how to set date as "11-Nov-2013" when i publish my project on the server(i know i should do it in iis but i dont know how to set the parameter in .Netglobazation, i set culture and UI culture as "Iit-IT",enable client base culture as "true",but still the date is "11-11-2013"

      but still it doesnt work.do i need to restart teh server?(by the way when i use visual studio in local the date is "11-Nov-2013" ),but when i run it on server it became "11-11-2013"

      could anyone do me a favpr to help me?thank u very much

    best regards

    Wednesday, November 27, 2013 10:27 AM

Answers

  • User1508394307 posted

    2 things

    1) it sounds like you have different web.config files on dev box and on the server.

    If you put it-IT in the web.config on the local machine you should get same date format as on the server (I think it is dd.mm.yyyy for Italy). If you want to know what culture is used on the box use

    CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
    Response.Write("culture is "+ci.Name.ToString()); 

    And you will see that they are different on local machine and server.

    2) date format could be changed with date formats 

    Just use e.g. date.ToString("dd-MMM-yyyy")

    http://msdn.microsoft.com/de-de/library/8kb3ddd4(v=vs.110).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 27, 2013 1:40 PM

All replies

  • User1508394307 posted

    2 things

    1) it sounds like you have different web.config files on dev box and on the server.

    If you put it-IT in the web.config on the local machine you should get same date format as on the server (I think it is dd.mm.yyyy for Italy). If you want to know what culture is used on the box use

    CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
    Response.Write("culture is "+ci.Name.ToString()); 

    And you will see that they are different on local machine and server.

    2) date format could be changed with date formats 

    Just use e.g. date.ToString("dd-MMM-yyyy")

    http://msdn.microsoft.com/de-de/library/8kb3ddd4(v=vs.110).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 27, 2013 1:40 PM
  • User444096333 posted

    hi smirnov:

      thank u very much for ur kindness help

    best regards

    martin

    Thursday, November 28, 2013 3:22 AM