how to have the exact date format from a dbf file when read using php code? ?

  • Thread starter Thread starter jum
  • Start date Start date
J

jum

Guest
hi, i have this problem when i read and display data from a dbf file using php code, the date retrieved is not the right date format (eg. date retrieve is: 39874) 39874 is not the right date format...how can i convert this to a more readable format...please help..

i used dbase_open() to read the file, and i was able to retrieve data from the dbf file correctly except for the date...please help...i'm a newbie in php...tnx and god bless..
 
If I append a record with a DATE type field, and enter today's date, it will be in the raw file as 8 characters in the form of, YYYYMMDD, and I will see 20081205 if I examine the raw data within the file. The exact location of the date field depends literally and directly on the structure and the sizes of the other fields in the DBF. Are you SURE you are reading the correct location within the raw file? If I have 2 date fields adjacent to each other, then I get YYYYMMDDYYYYMMDD in the raw data. There are NO field separators between fields. You need the structure to determine how long each field IS within the file. Date fields are always 8 characters. Are you SURE the "dbase" in the function IS a dBase type DBF file? I'll bet it is really a reference to a SQL database like used with MySQL, not a DBASE style DBF file used by DBASE, FOXPRO, CLIPPER and other DBF manager programs. Call up the HELP in MS Access, if you have it, and look for info on using DBF files made by Foxpro.
 
Back
Top