Categories > TinyButStrong general >

prb with frm and dates < 1970 (start of unix time)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: achille
Date: 2004-08-04
Time: 14:49

prb with frm and dates < 1970 (start of unix time)

Hi all.

TBS has a prb formating dates before unixtime (1970). I've tested that a few month ago. A today I tried again, and discovered that it is now working on my dev machine, but not on my prod server.

Here is the code
$tbs->LoadTemplate("test.html");
$tbs->MergeBlock("test",db,"select '1910-05-01' as ladate");
$tbs->Show(False);

and the template is just :
La date est : [test.ladate;frm='dd/mm/yyyy']  - [test.ladate]

On my dev machine, I have a "La date est : 01/05/1910 - 1910-05-01" and on the prod server I have "La date est : 01/01/1970 - 1910-05-01"
Any idea of where to investigate why is it working on some config and not other ? (php parameter ?)

By advance thx for the help.
By: Skrol29
Date: 2004-08-04
Time: 16:19

Re: prb with frm and dates < 1970 (start of unix time)

Hello Achille,

I remember you had this problem before.
For some configuration, strtotime() doesn't work for dates before 1970. It is due to the interval of validity of timestamps of the OS.
For Windows it is 01-01-1970 to 19-01-2038 :(

Is is not considered as a bug by the PHP team.
  http://bugs.php.net/bug.php?id=14313

I'm still looking for a small function that could do the same for any OS, but it is difficult to found. I've been told that a PEAR snippet could do it, but I've never found it.