PHP Classes

File: issue_date.txt

Recommend this page to a friend!
  Classes of Peter Klauer   mdb   issue_date.txt   Download  
File: issue_date.txt
Role: Documentation
Content type: text/plain
Description: Known issue with date < 1970
Class: mdb
Access Microsoft Access .mdb database files
Author: By
Last change:
Date: 20 years ago
Size: 1,646 bytes
 

Contents

Class file image Download
Problem: If I have a field "geburtstag" (german: Birthday) of type "date" in my access database which has a date before January, 1st 1970 then I receive with $mdb->fieldvalue('geburtstag') only a "-1" as result. Wenn ich in der Access-DB ein "geburtstag" Feld vom Typ "Date" habe, welches ein Datum VOR 1.1.1970 hat, dann bekomme ich mit $mdb->fieldvalue('geburtstag') nur ein "-1" als Ergebnis. What happened: (RTFM PHP Manual) *The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). *On Windows this range is limited from 01-01-1970 to 19-01-2038* *Der gültige Bereich für einen Zeitstempel erstreckt sich typischerweise von Fr., dem 13.12.1901 GMT bis Di., dem 19.01.2038 03:14:07 GMT. (diese Werte korrespondieren mit den Mini- und Maximalwerten für vorzeichenbehaftete Integer). *Bei Windows ist dieser Bereich auf den 1.01.1970 bis zum 19.01.2038 beschränkt. Solution: A workaround is to fix this problem already in the sql statement that queries the database. In this special case the following query worked: select *, str(Geburtstag) as Geburtstag from adressen You receive a string value containing the date string. Das Problem kann dadurch umgangen werden, dass man es bereits in der SQL- Abfrage erschlägt. In diesem speziellen Fall funktionierte die folgende Abfrage: select *, str(Geburtstag) as Geburtstag from adressen Sie erhalten einen String mit Datum als Zeichenkette. (Thanks to Martin Eisenführer)