Archived Forum Post

Index of archived forum posts

Question:

GetXmlDirListing attributes date

Oct 05 '16 at 02:08

Dear All,

A few days ago I have upgraded my FTP-client application to use the ChilKat libraries 9.5.0.59, To my surprise constructing a CTime failed until I looked what XML I got: the TAG lastModTime contains the attributes: full="20160929-100512" m="2016" d="9" y="29" hh="10" mm="5" ss="12" The attributes are used to construct the CTime, but it does like a year with 2016 month. I am using the C++ libraries with Visual Studio 2010-sp1.

Questions: 1) Is this a known issue/feature? 2) Any role for the regional settings in this issue?

kind regards Ton.


Accepted Answer

This new build should fix it:

http://chilkatdownload.com/prerelease/chilkat-9.5.0-x86-vc10-sp1.zip
http://chilkatdownload.com/prerelease/chilkat-9.5.0-x86_64-vc10-sp1.zip


Answer

Thanks! Sounds like a bug to me. I'll verify and work on a fix. I'll post a new build when it's ready..


Answer

Here's the new build with the fix:

http://chilkatdownload.com/prerelease/chilkat-9.5.0-x86-vc10-sp1.zip
http://chilkatdownload.com/prerelease/chilkat-9.5.0-x86_64-vc10-sp1.zip


Answer

Thanks for the Quick response,

I have downloaded the 'chilkat-9.5.0-x86-vc10-sp1.zip', installed it at the correct library location for my project and did a Batch-build->rebuild all but unfortunately, my correcting code still finds 2016 for the month. I have done a file compare upon the previous libraries and those are different. This is my code (part): if ((xmlTime = xmlFile->FindFirst ("lastModTime")) != (CXml *)NULL) { CTime t; int hh, mm, ss, d, m, y;

CAttribute *pAtt = xmlTime->m_Attributes; LOG_PRINTF((LG_DATA4, "Item Time: '%s'n", pAtt->m_strValue));

y = xmlTime->GetAttributeValue ("y"); m = xmlTime->GetAttributeValue ("m"); d = xmlTime->GetAttributeValue ("d"); hh = xmlTime->GetAttributeValue ("hh"); mm = xmlTime->GetAttributeValue ("mm"); ss = xmlTime->GetAttributeValue ("ss");

//2016sep28, V2.28.0.4, TWo: wrong planet detected ... if (m > 12) { // this cannot be a month ... int swapVal = m; m = d; // the value of Month is in the day ... d = y; // the value of Day is in the year ... y = swapVal; // the value of Year was in the month // YMD --> was --> DYM } Item->m_strDateTime.Format ("%.4d-%.2d-%.2dT%.2d:%.2d:%.2d", y, m, d, hh, mm, ss);

According to my logging: lastModTime full="20161003-095933" m="2016" d="10" y="3" hh="9" mm="59" ss="33"

Could you please re-check?

These results where with: 2016-09-30 11:51 43.831.766 ChilkatDbg.lib // time probably in gmt+1

Kind regards Ton.


Answer

I double-checked. It is correct.


Answer

Mea culpa, I overlooked there was a additional subfolder in the path to the new libraries, when I swapped them yesterday, which resulted in the old ones being linked ... my mistake, sorry!. However, with the new (corrected) library the year is correct while the month and day are still switched.

~~ The file on the server (sorry for the name): 2016-10-03 09:59 3 blabla.txt

~~ the XML directory listing <remotedir><file> <name>blabla.txt</name><size>3</size> <lastmodtime full="20161003-095933" y="2016" d="10" m="3" hh="9" mm="59" ss="33"/> </file></remotedir>

~~ The processing of the attributes Tue Oct 04 08:25:46 2016,Item Time: '20161003-095933' Tue Oct 04 08:27:59 2016,Item Time Proc: '2016-03-10T09:59:33'

I admit, I have 'complained wrongly' yesterday ... but with current findings, there still seems to be a mixup with European and American date-formating.

Kind regards Ton.


Answer

Thanks, I was only looking at the year/month. I'll make the fix right now and will post when the new build is ready. :-)


Answer

Dear ChilKat,

This indeed fixed it, Thank You!

Kind regards, Ton