Windows 7 What is the proper date time format for Windows 7 64 bit

umeshchaand

New Member
Joined
Jun 23, 2011
Messages
2
I get a date time exception while calculating time difference between two dates in C# code.

This occours only with 32 bit Windows 7.

Could anyone help me with this ..


return printDate.ToString("MM/dd/yyyy HH:mm:ss");
 


Solution
This works fine on my 32 and 64-bit Windows 7:

using System;


public class TimeTest
{
public static void Test()
{
DateTime time = DateTime.Now;
string format = "MM/dd/yyyy HH:mm:ss";
Console.WriteLine(time.ToString(format));
}
}
This works fine on my 32 and 64-bit Windows 7:

using System;


public class TimeTest
{
public static void Test()
{
DateTime time = DateTime.Now;
string format = "MM/dd/yyyy HH:mm:ss";
Console.WriteLine(time.ToString(format));
}
}
 


Solution
This works fine on my 32 and 64-bit Windows 7:

using System;


public class TimeTest
{
public static void Test()
{
DateTime time = DateTime.Now;
string format = "MM/dd/yyyy HH:mm:ss";
Console.WriteLine(time.ToString(format));
}
}
Hey Josephur, would that work in the UK but as dd/MM/yyyy HH:mm:ss, as we write the day first (smallest to largest, d,m,y!:))
 


He is trying to format it specifically it seems, however you can change the format however you would like or let the system choose.
 


Back
Top