mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-31 09:43:47 +02:00
SMB_DATE, SMB_TIME, UTime: Set DateTimeKind to Local
This commit is contained in:
parent
083d237ca6
commit
6d17dbabd6
2 changed files with 3 additions and 2 deletions
|
@ -46,7 +46,8 @@ namespace SMBLibrary.SMB1
|
||||||
int year = ((value & 0xFE00) >> 9) + 1980;
|
int year = ((value & 0xFE00) >> 9) + 1980;
|
||||||
int month = ((value & 0x01E0) >> 5);
|
int month = ((value & 0x01E0) >> 5);
|
||||||
int day = (value & 0x001F);
|
int day = (value & 0x001F);
|
||||||
return new DateTime(year, month, day);
|
// SMB_DATE & SMB_TIME are represented in the local time zone of the server
|
||||||
|
return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Local);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void WriteSMBDate(byte[] buffer, int offset, DateTime date)
|
public static void WriteSMBDate(byte[] buffer, int offset, DateTime date)
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace SMBLibrary.SMB1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UTimeHelper
|
public class UTimeHelper
|
||||||
{
|
{
|
||||||
public static readonly DateTime MinUTimeValue = new DateTime(1970, 1, 1);
|
public static readonly DateTime MinUTimeValue = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local);
|
||||||
|
|
||||||
public static DateTime ReadUTime(byte[] buffer, int offset)
|
public static DateTime ReadUTime(byte[] buffer, int offset)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue