Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the C# Convert.ToDateTIme function read date as "dd/mm/yyyy" or "mm/dd/yyyy"?

Does the C# Convert.ToDateTIme function read date as "dd/mm/yyyy" or "mm/dd/yyyy"?

I have the same application on my local machine which I uploaded to my remote shared server. It was working perfectly on my local machine reading "dd/mm/yyyy", but on my remote machine, it seems to read dates as "mm/dd/yyyy". I have the same culture setting "en-GB" on both.

I find this date conversion very unpredictable. Can anyone recommend a culture-proof way of reading date strings from a SQL Server 2005 database?

like image 251
Avinash Avatar asked Apr 21 '09 06:04

Avinash


People also ask

Which is positive C or T?

One coloured line should be in the control line region (C), and another coloured line should be in the test line region (T). Two lines, one next to C and one next to T, even faint lines, show the test is positive.

Is the C on a Covid test negative?

If you have 1 line by C, and 1 line by T this is called a positive result. The lines can be bright or faint. You have COVID-19. If you have 1 line by C, and no line by T this is called a negative result.

What does the C and T mean on the lateral flow test?

This is what the test “window” looks like in the strip after 30 minutes. “C” stands for “control” – this is to make sure the test is working. “T” stands for “test” – this is where your sample result will appear. Image © https://www.gov.uk/ Negative result: one line next to C shows the test is negative.

What is C and T in rapid test?

Positive Result: If you see two lines, Control (C) line and Test (T) line, this means COVID-19 was detected. If positive, please contact your doctor or local health department immediately and follow local guidelines for self-isolation. + 2. Ensure kit is at room temperature for at least 30 minutes prior to use.


1 Answers

Well by the sounds of it... One of the settings on the server is off.

I'd go through the "Region & Language" Options with a fine tooth comb and make sure that something isn't override but if that fails.

You could try explicitly setting the Culture Info

         string x = "21/01/2009";

        CultureInfo ci = new CultureInfo("en-GB");

        Convert.ToDateTime(x, ci);
like image 163
Eoin Campbell Avatar answered Nov 04 '22 08:11

Eoin Campbell