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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:32:02+00:00 2026-06-13T13:32:02+00:00

I have C# code that does the following: DateTime now = DateTime.UtcNow; string timeToOutput

  • 0

I have C# code that does the following:

 DateTime now = DateTime.UtcNow;
 string timeToOutput = now.ToString();
 String pathInStorage = now.ToString("yyyy-MM-dd/HH/");

 CloudBlobClient client = getClient();
 CloudBlobContainer container = client.GetContainerReference(hardcodedContainerName);
 container.GetBlobReference(pathInStorage).UploadText(timeToOutput);

as you see, I first obtain current time and then format it twice using different format strings. Now most of the time the path in the storage will match the time output into the blob itself.

Yet sometimes (very rarely) time in the blob will be of year 2012 (like 12:33:00 Oct 29 2012), but the path will contain year 2555 and hour-day-month will match those of the time inside the blob (like 2555-10-29-12).

How could this happen?

  • 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-06-13T13:32:02+00:00Added an answer on June 13, 2026 at 1:32 pm

    Year 2555 is 2012 in Thai Solar Calendar. Not sure why are you getting this, perhaps a server executing the code has a Thai locale?

    To get the code to run as you expect, use a different, locale-aware version of ToString(). See DateTime.ToString()

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

Sidebar

Related Questions

I currently have code that does the following: private final static ExecutorService pool =
I have following code that does not work due to a being a value
I have following code that does not work: I never get to goToFoodDetail .
I have a line of PHP code that does the following: $xml = <xml><request>...[snipped
I have the following code; I want to make sure that submit does not
I have the following piece of SQL code that does the following: Obviously looks
i have the following Code: if (v != null && DateTime.Now > v.Besetzt_Von) {
I have code that does a web-service request. While doing this request I need
I have some code that does MemoryStream ms = new MemoryStream(); ... return Image.FromStream(ms);
I have photo gallery code that does image re-sizing and thumbnail creation. I use

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.