locked
Get the date format of the client RRS feed

  • Question

  • User-388892677 posted

    Hi,

    Following code gives me the date format for the web server. Is it possible to get the date format for client computer (computer running Internet explorer to see the page)

      

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
            Response.Write("Culture Date Format " & Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.ToString())
            Response.Write("<br>")
            Response.Write("UI Culature Date Form " & Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.ToString())
        End Sub
     
    Wednesday, September 27, 2006 2:00 PM

Answers

  • User-1936818034 posted
    Hi~ Try set the culture programatically: 
    Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
    Response.Write(culture.DateTimeFormat.ShortDatePattern)
    
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 29, 2006 4:22 AM
  • User-388892677 posted
    Thanks Gordon. That's what I am looking for.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 29, 2006 10:42 AM

All replies