Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:28:34+00:00 2026-05-10T20:28:34+00:00

How do you globally set the date format in ASP.NET? My local machine and

  • 0

How do you globally set the date format in ASP.NET?

My local machine and servers have Regional Settings set to ‘English (New Zealand)’.

When I format a date with dd/MM/yyyy I expect to see 19/11/2008 for today for example.

Until recently, that is what I did in fact get from both my local machine and the servers.

Just recently, for some mysterious reason, our local machines have changed ever so slightly. Despite still be set to ‘English (New Zealand)’, the date delimter has changed from / to -! The same change has not occurred on the servers which still show ‘English (New Zealand)’ and the / for the date delimter.

So now for my local machine, for the format dd/MM/yyyy I get 19-11-2008 instead of 19/11/2008.

This is a little disconcerting.

The only way around it that I can see so far is to escape the slashes and set the format to dd\/MM\/yyyy. It seems to work, but it doesn’t seem to be the ideal solution.

Can anyone please help?

NOTE: This is for an intranet application and I do not care about true globalisation. I just want to fix the date format and not have it change on me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:28:34+00:00Added an answer on May 10, 2026 at 8:28 pm

    You can change the current thread culture in your Global.asax file, and override the date format for example:

    using System.Globalization; using System.Threading;  //... protected void Application_BeginRequest(Object sender, EventArgs e) {       CultureInfo newCulture = (CultureInfo) System.Threading.Thread.CurrentThread.CurrentCulture.Clone();   newCulture.DateTimeFormat.ShortDatePattern = 'dd-MMM-yyyy';   newCulture.DateTimeFormat.DateSeparator = '-';   Thread.CurrentThread.CurrentCulture = newCulture; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 86k
  • Answers 86k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SQL Server 2005 allows you to write native functions for… May 11, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer Subsonic code generation will read the foreign key relationships in… May 11, 2026 at 5:17 pm
  • Editorial Team
    Editorial Team added an answer In XPath/XSLT 1.0, to select (or match) an element that's… May 11, 2026 at 5:17 pm

Related Questions

I have a project with several sources directories : src/A /B /C In each,
Questions : What does the kernel do if you stick a shell-script into the
Here is part of my code define('DIR_APP', 'app/'); class Questions { const QUESTIONS_FILE =
Storing personal names in a structured way seems quite difficult when it comes to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.