|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
sotskiy Smarty n00b
Joined: 26 Feb 2004 Posts: 2
|
Posted: Thu Feb 26, 2004 1:58 pm Post subject: Problem with date format |
|
|
For some reason all dates early 1 Jan 1970 shown incorrect.
For example I have next code: Code: | {$birthDay|date_format} |
if $birthDay date more then 1 Jan 1970 everything works fine but if early I recieve 1 Jan 1970 as output.
I found that PHP function strtotime used for date validation and it's return "-1"
Does anybody know what I should do?
Thanks in advance.
Last edited by sotskiy on Wed May 05, 2010 11:02 pm; edited 1 time in total |
|
Back to top |
|
sotskiy Smarty n00b
Joined: 26 Feb 2004 Posts: 2
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Feb 27, 2004 2:30 pm Post subject: |
|
|
date_format uses strftime which has this limitation (and I think date has it too). It wouldn't be too difficult to create a function that uses Date_Calc from PEAR, or extend date_format to use it.
http://pear.php.net/package/Date |
|
Back to top |
|
Duncan Smarty Pro
Joined: 16 Dec 2003 Posts: 166
|
Posted: Fri Feb 27, 2004 2:45 pm Post subject: |
|
|
From the php manual: http://de2.php.net/manual/en/function.strtotime.php
Quote: | Note: 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.) Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|