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 7625943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:15:34+00:00 2026-05-31T05:15:34+00:00

I have come across a strange problem. MY app has been localized to support

  • 0

I have come across a strange problem. MY app has been localized to support 5 languages.
It is a calendar sort of app, and i have an option of writing notes for a particular date.
So when I change my language settings to Russian, enter a note on a date, eg 1/3/2012 and on 6/3/2012. This date and note is stored in an IsolatedStorageFile and i exit the app.

Now, I change my language settings to english, and the notes are stored in 3/1/2012 and 3/6/2012. The month and date are reversed !! 🙁

This is how i write the notes to the file

using (IsolatedStorageFileStream fileStream = storagefile.OpenFile("NotesFile", FileMode.Open, FileAccess.ReadWrite))
{
    StreamWriter writer = new StreamWriter(fileStream);

    for (int i = 0; i < m_noteCount; i++)
    {
        writer.Write(m_arrNoteDate[i].ToShortDateString());
        writer.Write(" ");
        writer.Write(m_arrNoteString[i]);
        writer.WriteLine("~`");
    }
    writer.Close();
}

Reading is from file is done like this

if (notes.Substring(i, 1) == " ")
{
      m_arrNoteString[count] = notes.Substring(i + 1);
      string temp = notes.Substring(0, i);
      m_arrNoteDate[count] = DateTime.Parse(temp);
      count++;
      nextCharacter = (char)reader.Read();
      notes = "";
      break;
}

the parser reads date in a format according to language the device is set to? Any work arounds?

Alfah

  • 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-31T05:15:34+00:00Added an answer on May 31, 2026 at 5:15 am

    By default, the conversion between dates and strings (and vice versa) uses the current culture. For your purpose, since you are not converting to/from strings for the purpose of displaying dates to the user but to persist them, you should make your logic independent of the current culture by specifying a given culture. And the invariant culture is your best best.

    So replace this:

    writer.Write(m_arrNoteDate[i].ToShortDateString());
    

    With this:

    writer.Write(m_arrNoteDate[i].ToString("d", CultureInfo.InvariantCulture);
    

    And replace this:

    m_arrNoteDate[count] = DateTime.Parse(temp);
    

    With this:

    m_arrNoteDate[count] = DateTime.Parse(temp, CultureInfo.InvariantCulture);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have come across a strange problem with Zend_Framework, I can not load forms
I've come across a really strange problem. I have written a simple Deck class
I've come across a strange thing in Firefox, which has become a problem to
I have come across some strange behavior in my iPhone Objective-C app. I am
I have come across some strange behaviour, and I'm assuming a bug in Firefox,
I have just come across something that is quite strange and yet I haven't
I have come across what must be a common problem. When I have an
I have come across a strange defect. I am using Orbeon 3.9 CE on
I have come across a strange behavior of Java that seems like a bug.
I just come across a strange problem where i cannot retrieve the sql stored

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.