Re: Re[2]: [PHP-GTK-DEV] GtkCalendar::get_date()
| From: | Steph Fox | Date: | Wed, 15 Mar 2006 11:31:48 +0000 |
| Subject: | Re: Re[2]: [PHP-GTK-DEV] GtkCalendar::get_date() | ||
| References: | 1 2 3 4 5 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2615@lists.php.net to get a copy of this message | ||
Hi Tom,
Yep, we discussed it at some length - don't you remember? - and in fact this is still part of the same discussion. It just sorta went into hibernation for a while there.
I was looking at an implementation that uses a BC wrapper named php_mktime().... something had changed (e.g. ext/date) to make it useable for returning a timestamp in PHP 5_1 API. And then Christmas interfered with the creative process and everyone (okay, I) forgot all about it :-( Now Andrei's saying there are too many ways to convert the ymd triplet to a timestamp, but I don't know about that... that wrapper covers all the possibilities he mentioned.
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
RETURN_FALSE;
}
Basically we'd need a GST (UTC these days?) flag to determine whether we're asking for mktime() - I think that would be the default - or gmmktime(), and another flag to allow PHP-GTK users to switch off DST. Although that DST parameter throws an E_STRICT at present, I can see that function potentially changing in future to override the parameter and fully use the timezone information available to it; currently it ignores the existence of DST when it's calculating, so we _have_ to use it if we want to reflect local time. If that's not altogether clear, take a look at this:
C:\php5>php -r "echo ini_get('date.timezone');"
Europe/London
C:\php5>php -r "echo date('M d Y', mktime(0, 0, 0, 1, 15, 06));"
Jan 15 2006
C:\php5>php -r "echo date('M d Y', mktime(0, 0, 0, 6, 15, 06));"
Jun 15 2006
C:\php5>php -r "echo date('M d Y', mktime(0, 0, 0, 1, 15, 06, 1));"
Strict Standards: mktime(): The is_dst parameter is deprecated in Command line code on line 1
Jan 14 2006
C:\php5>php -r "echo date('M d Y', mktime(0, 0, 0, 6, 15, 06, 1));"
Strict Standards: mktime(): The is_dst parameter is deprecated in Command line code on line 1
Jun 15 2006
I switched to London because I'm not entirely sure what the DST situation is in Jerusalem this (or any other) year, but London's fairly predictable :)
- Steph
----- Original Message ----- From: "Tom Rogers" <trogers@kwikin.com>
To: "PHP-GTK Dev list" <php-gtk-dev@lists.php.net>
Sent: Wednesday, March 15, 2006 11:05 AM
Subject: Re[2]: [PHP-GTK-DEV] GtkCalendar::get_date()
Hi, Wednesday, March 15, 2006, 6:05:22 PM, you wrote:CW> Again? Did you ever look at the version I submitted? -- regards, Tom -- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.comOh, I guess I forgot to commit. :)