Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct _timeb {
- long time; // 4 bytes
- unsigned short millitm; // 2 bytes
- short timezone; // 2 bytes
- short dstflag; // 2 bytes
- };
- DateTime dateTime = DateTime::UtcNow;
- DateTime baseTime(1970, 1, 1, 0, 0, 0, DateTimeKind::Utc);
- TimeSpan delta = dateTime - baseTime;
- _timeb timestamp;
- timestamp.time = delta.TotalSeconds;
- timestamp.millitm = dateTime.Millisecond;
- timestamp.dstflag = TimeZoneInfo::Local->IsDaylightSavingTime(dateTime) ? 1 : 0;
- timestamp.timezone = TimeZoneInfo::Local->BaseUtcOffset.TotalMinutes * -1;
Add Comment
Please, Sign In to add comment