Hi,
I am working on a C# project and part of which is to read a byte data from both UNIX and WIN machines.
Some byte data correspond to date and time. So here is the task that I need I do.
1. Convert byte to long.
2. Convert long to DateTime
3. Convert DateTime to String.
Problem.
When converting datetime, I need to use two epoch time to be able to correctly convert the byte data to datetime string.
Code that works
for files created on UNIX System
public readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).ToLocalTime();
Code that works
for files created on WINDOWS System
public readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local).ToLocalTime();
Question.
Is there a single epoch date time format that will work for both UNIX and WINDOWS?
Please help.