Hi Oleksii, To get just 20 instead of 120, you need the following line: hb_rddInfo( RDDI_SETHEADER, DB_SETHEADER_YYEAR ) Search this group for more info about DB_SETHEADER_YYEAR. It was discussed in several threads in 2015. Regards, Klas Den 2020-10-01 kl. 11:11, skrev oleksa: > Hi! > > The year of last update in header of dbf is wrong for 2020, look at sample: > > proc main > local cYear > local hFile > > dbcreate( "test_y", {{"F1","C",10,0}},, .T. ) > dbAppend() > ?lUpdate() > use > > cYear := hb_BChar( 0 ) > IF ( hFile := hb_vfOpen( "test_y.dbf" ) ) != NIL > hb_vfSeek( hFile, 1 ) > hb_vfRead( hFile, @cYear , hb_BLen( cYear ) ) > ? "Last update (year):", Bin2I( cYear ) > hb_vfClose( hFile ) > ELSE > ? "Cannot open file" > ENDIF > > return > > The year is 120, why? > > Regards, > Oleksii Myronenko -- You received this message because you are subscribed to the Google Groups "Harbour Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-devel/37c4b65a-4299-943e-4d72-dc895bc603ed%40engwall.com.
Hi Olekeii, > Ok, thank you. > Need we correct the sample of Bin2I in core/doc/en/binnum.txt? I don't see a good reason for doing that. It has nothing to do with number conversions. The 120 result is Clipper compatible and refers to the year 1900 rather than to the beginning of the current century. The DB_SETHEADER_YYEAR setting is a convention, not a correction, and is related to 1) concurrent DBF file use between Harbour and tools that are not Clipper compatible and 2) whether you want to see the century (1900++) in the lupdate() year or not, which is entirely up to the user to decide. Regards, Klas -- You received this message because you are subscribed to the Google Groups "Harbour Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-devel/cd3527f1-6d2d-09d4-2d44-4c165eb5f2e2%40engwall.com.