Date bug? For me, August changes to September

David Fletcher dave at thefletchers.net
Sun Oct 13 09:11:50 UTC 2013


On Sun, 2013-10-13 at 09:11 +0200, Nils Kassube wrote:
> > Everything else is correct EXCEPT that August has changed into
> > September! How the hell has that happened?
> 
> From the mktime man page:
> 
> | tm_mon  
> |  The number of months since January, in the range 0 to 11.
> 
> Therefore you should use this line to assign the month value:
> 
> PointTimeStruct.tm_mon = atoi(GFTag.c_str() + 11) - 1;
> 
> 
> Nils
> 
> 
Thanks Nils for pointing that one out. I was thinking after I went to
bed, could it be that? Even though the day of the month is numbered
normally? Surely not!

OK I'll -1 and carry on with the coding.

Dave






More information about the ubuntu-users mailing list