[PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Well, I've read the manual, and the ADOdb Date package functions, and I am not using this because I want to keep my framework simple, flexible, and fast. Well, I just want a simple way to translate dates (I know what is the input format) to unix timestamp, with ability to do this with

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Richard Davey
Hello Bruno, Thursday, July 7, 2005, 7:04:44 PM, you wrote: BBBM I've read the manual, and the ADOdb Date package functions, and BBBM I am not using this because I want to keep my framework simple, BBBM flexible, and fast. BBBM Well, I just want a simple way to translate dates (I know what BBBM

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Richard, Well, I took a look at, and I think it is TOO complex to handler a simple thing.. Well, that's my little contribution: function str2time($input = '12/31/1969') { $year= substr($input, -4); $input= substr_replace($input, 1976 , -4);

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Folks, Well I think I got it, at least it's working more or less to me now... I really would appreciate any comments or suggestions. function str2time($input = '12/31/1969') { if(($output = strtotime($input)) !== -1) { return $output; }

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Edward Vermillion
On Jul 7, 2005, at 7:54 PM, Bruno B B Magalhães wrote: Hi Folks, Well I think I got it, at least it's working more or less to me now... I really would appreciate any comments or suggestions. function str2time($input = '12/31/1969') { if(($output = strtotime($input)) !== -1)

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Edward, thanks for replying! On Jul 7, 2005, at 10:44 PM, Edward Vermillion wrote: One problem is that there's no accounting for leap years, but I don't know if that's gonna cause you any problems or not. Course it have, when we multiply the year offset by 31557376.189582 we are using

Re: [PHP] TimeStamp BEFORE 1970 AND AFTER 2035

2005-07-07 Thread Bruno B B Magalhães
Just a quick fix, as now I've tested in a real environment, with a real application, and now it's working 100%, well, I think so. / * * Stritotime workaround for dates before 1970 and after 2038

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Edward Vermillion
On Jul 7, 2005, at 10:17 PM, Bruno B B Magalhães wrote: Hi Edward, thanks for replying! [snip] Why 1976, because it's a leap year and is between valid range for windows systems. Let me try to explain the rest. First I get the input year... which by the way is working fine here...