cvs: /php3 ChangeLog /php3/functions datetime.c
| From: | Marko Karppinen | Date: | Wed, 14 Jul 1999 14:42:04 +0000 |
| Subject: | cvs: /php3 ChangeLog /php3/functions datetime.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-8502@lists.php.net to get a copy of this message | ||
markonen Wed Jul 14 14:42:04 1999 EDT
Modified files:
/php3 ChangeLog
/php3/functions datetime.c
Log:
Support for Swatch(r) Beat(tm), also known as Swatch Internet Time
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.725 php3/ChangeLog:1.726
--- php3/ChangeLog:1.725 Mon Jul 12 15:21:25 1999
+++ php3/ChangeLog Wed Jul 14 14:42:03 1999
@@ -2,6 +2,8 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
??, Version 3.0.12
+- Support for Swatch(r) Beat(tm), also known as Internet Time.
+ Use by including "B" in the date() or gmdate() format string. (markonen)
- added gmstrftime() (like strftime() but prints out in GMT not local
time) (David Sklar)
- A hack to allow 4bit antialiasing by modifying Freetype2 source (markonen)
Index: php3/functions/datetime.c
diff -u php3/functions/datetime.c:1.68 php3/functions/datetime.c:1.69
--- php3/functions/datetime.c:1.68 Mon Jul 12 15:21:25 1999
+++ php3/functions/datetime.c Wed Jul 14 14:42:03 1999
@@ -30,7 +30,7 @@
*/
-/* $Id: datetime.c,v 1.68 1999/07/12 19:21:25 sklar Exp $ */
+/* $Id: datetime.c,v 1.69 1999/07/14 18:42:03 markonen Exp $ */
#ifdef THREAD_SAFE
@@ -188,7 +188,7 @@
pval *format, *timestamp;
time_t the_time;
struct tm *ta;
- int i, size = 0, length, h;
+ int i, size = 0, length, h, beat;
char tmp_buff[16];
TLS_VARS;
@@ -263,6 +263,9 @@
}
case 'w': /* day of the week, numeric */
case 'L': /* boolean for leap year */
+ case 'B': /* Swatch Beat, 3 digits */
+ size += 3;
+ break;
default:
size++;
break;
@@ -405,6 +408,13 @@
#else
strcat(return_value->value.str.val, tzname[0]);
#endif
+ break;
+ case 'B': /* Swatch Beat a.k.a. Internet Time */
+ beat = (((((long)the_time)-(((long)the_time) -
+ ((((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;
default:
length = strlen(return_value->value.str.val);