Click here to Skip to main content
15,924,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: Use C# for Addin in Excel Pin
Skynyrd10-Mar-05 6:55
Skynyrd10-Mar-05 6:55 
Generalsmall project on c# Pin
dipesh patel10-Mar-05 6:36
dipesh patel10-Mar-05 6:36 
GeneralRe: small project on c# Pin
Judah Gabriel Himango10-Mar-05 6:59
sponsorJudah Gabriel Himango10-Mar-05 6:59 
GeneralRe: small project on c# Pin
sachinkalse11-Mar-05 20:00
sachinkalse11-Mar-05 20:00 
GeneralMicrosoft Project 2000 Pin
OMalleyW10-Mar-05 5:41
OMalleyW10-Mar-05 5:41 
Generalabstract static properties Pin
Andrew Torrance10-Mar-05 5:38
Andrew Torrance10-Mar-05 5:38 
GeneralRe: abstract static properties Pin
J4amieC10-Mar-05 6:22
J4amieC10-Mar-05 6:22 
GeneralcTime Pin
exhaulted10-Mar-05 5:07
exhaulted10-Mar-05 5:07 
Hi all.
I'm trying to read in the date and time from a binary file that was created using mfc. The cTime class was used to create the time stamp. I'm using a TimeSpan object and a DateTime object in order to get the date and time that was saved in the binary file. i.e.
public Count(BinaryReader read)
{
  TimeSpan span = TimeSpan.FromSeconds(read.ReadUInt32());
  TimeStamp = new DateTime(span.Ticks);
  CountNumber = read.ReadUInt32();
}


The date and time returned ends up coming out as 18/02/0035 16:00:01 which is obviously incorrect as this is old data not future data Smile | :)

I looked at the number of ticks returned in span.Ticks compared to the current number of ticks (at roughly 15:22 today)
632460649505030970 - Today
10771200010000000 - Returned from the file.

As you can see there is a big difference and im pretty sure this data is only a year old at the most.
If anyone knows what i'm doing wrong it would be greatly appreciated.

Cheers


Kev
GeneralRe: cTime Pin
leppie10-Mar-05 6:40
leppie10-Mar-05 6:40 
GeneralRe: cTime Pin
exhaulted10-Mar-05 6:51
exhaulted10-Mar-05 6:51 
GeneralRe: cTime Pin
Dave Kreskowiak10-Mar-05 10:29
mveDave Kreskowiak10-Mar-05 10:29 
GeneralRe: cTime Pin
exhaulted10-Mar-05 11:03
exhaulted10-Mar-05 11:03 
GeneralRe: cTime Pin
Dave Kreskowiak10-Mar-05 11:46
mveDave Kreskowiak10-Mar-05 11:46 
GeneralRe: cTime Pin
exhaulted10-Mar-05 21:32
exhaulted10-Mar-05 21:32 
GeneralLower Process Priority Pin
bk515110-Mar-05 4:18
bk515110-Mar-05 4:18 
GeneralRe: Lower Process Priority Pin
TylerBrinks10-Mar-05 4:39
TylerBrinks10-Mar-05 4:39 
GeneralRe: Lower Process Priority Pin
bk515110-Mar-05 4:47
bk515110-Mar-05 4:47 
GeneralRe: Lower Process Priority Pin
TylerBrinks10-Mar-05 5:16
TylerBrinks10-Mar-05 5:16 
GeneralRe: Lower Process Priority Pin
Guinness4Strength10-Mar-05 4:45
Guinness4Strength10-Mar-05 4:45 
GeneralRe: Lower Process Priority Pin
bk515110-Mar-05 5:07
bk515110-Mar-05 5:07 
GeneralRe: Lower Process Priority Pin
Guinness4Strength10-Mar-05 5:16
Guinness4Strength10-Mar-05 5:16 
GeneralRe: Lower Process Priority Pin
bk515110-Mar-05 7:44
bk515110-Mar-05 7:44 
GeneralDetect Missing Image Pin
rowlandISD10-Mar-05 3:36
rowlandISD10-Mar-05 3:36 
GeneralRe: Detect Missing Image Pin
turbochimp11-Mar-05 17:00
turbochimp11-Mar-05 17:00 
QuestionParse eml files? Pin
cool_wali10-Mar-05 3:06
cool_wali10-Mar-05 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.