tiny patch to extend date()'s functionality
| From: | Jade Nicoletti | Date: | Sun, 26 Mar 2000 16:33:01 +0000 |
| Subject: | tiny patch to extend date()'s functionality | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12633@lists.php.net to get a copy of this message | ||
Hi
I haven't seen a possibility to determine wheter a given timestamp is in
daylight saving time or not. Here's the tiniest possible patch to get the info.
if (date('I', $my_time_stamp)) echo "summer time =)";
Are there other approches? If there aren't, you may apply the patch to the cvs.
-Jade.
*** datetime.c~ Sun Mar 12 16:47:32 2000 --- datetime.c Sun Mar 26 18:14:29 2000 *************** *** 270,275 **** --- 270,276 ---- size += 3; break; case 'w': /* day of the week, numeric */ + case 'I': /* daylight saving time */ default: size++; break; *************** *** 418,423 **** --- 419,428 ---- ((((long)the_time) % 86400) + 3600))) * 10) / 864); if (beat > 999) beat = 0; sprintf(tmp_buff, "%03d", beat); /* SAFE */ + strcat(return_value->value.str.val, tmp_buff); + break; + case 'I': /* daylight saving time */ + sprintf(tmp_buff, "%d", ta->tm_isdst); strcat(return_value->value.str.val, tmp_buff); break; default:
*** datetime.c~ Sun Mar 12 16:47:32 2000 --- datetime.c Sun Mar 26 18:14:29 2000 *************** *** 270,275 **** --- 270,276 ---- size += 3; break; case 'w': /* day of the week, numeric */ + case 'I': /* daylight saving time */ default: size++; break; *************** *** 418,423 **** --- 419,428 ---- ((((long)the_time) % 86400) + 3600))) * 10) / 864); if (beat > 999) beat = 0; sprintf(tmp_buff, "%03d", beat); /* SAFE */ + strcat(return_value->value.str.val, tmp_buff); + break; + case 'I': /* daylight saving time */ + sprintf(tmp_buff, "%d", ta->tm_isdst); strcat(return_value->value.str.val, tmp_buff); break; default: