Back to index

php5  5.3.10
Functions | Variables
datetime.c File Reference
#include "php.h"
#include "zend_operators.h"
#include "datetime.h"
#include "php_globals.h"
#include <time.h>
#include <stdio.h>

Go to the source code of this file.

Functions

PHPAPI char * php_std_date (time_t t TSRMLS_DC)

Variables

char * mon_full_names []
char * mon_short_names []
char * day_full_names []
char * day_short_names []

Function Documentation

PHPAPI char* php_std_date ( time_t t  TSRMLS_DC)

Definition at line 54 of file datetime.c.

{
       struct tm *tm1, tmbuf;
       char *str;

       tm1 = php_gmtime_r(&t, &tmbuf);
       str = emalloc(81);
       str[0] = '\0';

       if (!tm1) {
              return str;
       }

       if (PG(y2k_compliance)) {
              snprintf(str, 80, "%s, %02d %s %04d %02d:%02d:%02d GMT",
                            day_short_names[tm1->tm_wday],
                            tm1->tm_mday,
                            mon_short_names[tm1->tm_mon],
                            tm1->tm_year + 1900,
                            tm1->tm_hour, tm1->tm_min, tm1->tm_sec);
       } else {
              snprintf(str, 80, "%s, %02d-%s-%02d %02d:%02d:%02d GMT",
                            day_full_names[tm1->tm_wday],
                            tm1->tm_mday,
                            mon_short_names[tm1->tm_mon],
                            ((tm1->tm_year) % 100),
                            tm1->tm_hour, tm1->tm_min, tm1->tm_sec);
       }

       str[79] = 0;
       return (str);
}

Here is the call graph for this function:


Variable Documentation

char* day_full_names[]
Initial value:
 {
       "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
}

Definition at line 44 of file datetime.c.

char* day_short_names[]
Initial value:
 {
       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
}

Definition at line 48 of file datetime.c.

char* mon_full_names[]
Initial value:
 {
       "January", "February", "March", "April",
       "May", "June", "July", "August",
       "September", "October", "November", "December"
}

Definition at line 34 of file datetime.c.

char* mon_short_names[]
Initial value:
 {
       "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}

Definition at line 40 of file datetime.c.