I use DateTime.Now in my program and it work correctly.
I run my program 24hrs/day .
But it work correctly for 6hrs after that it retrun wrong date and time to my program
and I have to restart the program to make it work correctly again.
example
I run program at 31/10/2006 but it return 299/12/2006 to me.
I don't know what is the problem.
I can't fix it.
Anyone can help me
Thank

I have problem when use DateTime class
--Alan---
string tempname = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString("00");
string filename = "log/TBG" + tempname + ".txt";
string filename_temp = "temp/TBG" + tempname + ".txt";
string filename_server = server_st + tempname + ".txt";
//file handle for local log
FileStream tbg_log = new FileStream(filename, FileMode.Append, FileAccess.Write);
StreamWriter tbg_writer = new StreamWriter(tbg_log);
//file handle for server temp log
FileStream server_temp = new FileStream(filename_temp, FileMode.Append, FileAccess.Write);
StreamWriter temp_writer = new StreamWriter(server_temp);
lock (tbg_log)
{
//if connection from com1
if (source.Port == st_port[0])
{
if (buf.Substring(0, 3) == "1NZ" || buf.Substring(0, 3) == "1ZZ" || buf.Substring(0, 3) == "3ZZ")
{
//write to temp file
string data_value = buf + ",1," + DateTime.Now.Date.ToShortDateString() + "_" + DateTime.Now.ToLongTimeString();
Rod Yager
Bianca J.
To see if this has anything to do with your problem, start using DateTime.UtcNow instead of DateTime.Now. Let us know if the problem goes away...
Nick...A
And this is the result of my program
TBG20061030
TBG20061031
PAS20061031
TBG200612299<<<< WRONG DATE AND TIME AFTER RUN PROGRAM FOR 6HRS.
PAS200612299 <<<< WRONG DATE AND TIME AFTER RUN PROGRAM FOR 6HRS.
Anyone know about this problem
Please help me!!!!
Thank