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

  • SEARCH
  • Home
  • 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 3302778
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:53:17+00:00 2026-05-17T20:53:17+00:00

I am trying to make a small application for a project in which clients

  • 0

I am trying to make a small application for a project in which clients from across the world can use. The problem I am having is that the back-end is setup using XML files that gets generated and uploaded to a shared network and in these XML files I store a date time variable that says when a particular task started and finished. The program crashes at certain load intervals with a format exception and after some research I found out that I need to setup a regional date time parser.

The question that I have is how can I convert the time in the XML file, whether it’s using US, AU, or UK regional settings, and have it use the client’s local settings. This is being done using VS C# 2005 and the .NET 3.5 framework.

Thanks in advance for your help.

  • 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. Editorial Team
    Editorial Team
    2026-05-17T20:53:17+00:00Added an answer on May 17, 2026 at 8:53 pm

    The backends should be writing in a standard format. The XML shouldn’t just use the local date format – that way madness lies. The main point of XML is to be an interchange format for computers, not for humans. Unless you’re formatting something for human consumption, you shouldn’t be using local variation.

    So either use a specific format everywhere, specifying CultureInfo.InvariantCulture when formatting, or use dt.ToString("o") or another of the culture-invariant format strings.

    If you’re just talking about a point in time (i.e. the local time doesn’t matter, just the global instant) you should also make sure you use a consistent time zone, where UTC is the obvious choice. For example, use DateTime.UtcNow instead of DateTime.Now.

    Once you’ve got the generation code doing sensible things, consuming it should be very straightforward.

    If, however, you don’t have the luxury of changing the generation code, you may have to resort to passing the right CultureInfo into DateTime.TryParseExact. However, this means that you’ll need to know the culture used to create the file. If the files are being generated in a culture-sensitive way and you don’t know which culture they’re using, you’re basically stuffed. For example, 03/05/2010 could mean March 5th 2010 or May 3rd 2010. Without any more information, you have no way of deciding which to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make some small changes to Apache's Velocity engine. Here's what I can
I'm trying to make a document that has a very small font throughout, I
i am stuck with this small problem in my code. I am trying to
I am trying to make a small change to a Ruby script so i
I'm trying to make an algorithm that will find the most efficient ordering for
DISCLAIMER: At my place of work we are aware that, as none of us
I am trying to accomplish an imagemap in flash where you click on different
I'm just starting out with NServiceBus and have updated the PubSub sample to work
My first forray into ajax webpages is causing me some problems. My basic structure

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.