pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:3211:    *! queries the time internally when a thread has waited for    *! something, typically in @[sleep] or in a backend (see    *! @[Pike.Backend]).    *!    *! The third syntax can be used to measure time more precisely than one    *! second. It returns how many seconds have passed since @[t]. The precision    *! of this function varies from system to system.    *!    *! @seealso    *! @[ctime()], @[localtime()], @[mktime()], @[gmtime()], -  *! @[System.gettimeofday], @[gethrtime] +  *! @[System.gettimeofday()], @[gethrtime()]    */   PMOD_EXPORT void f_time(INT32 args)   {    struct timeval ret;    if(!args ||    (TYPEOF(Pike_sp[-args]) == T_INT && Pike_sp[-args].u.integer == 0))    {    ACCURATE_GETTIMEOFDAY(&ret);    pop_n_elems(args);    push_int(ret.tv_sec);
pike.git/src/builtin_functions.c:5529:   }      /*! @decl mapping(string:int) gmtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.    *!    *! This function works like @[localtime()] but the result is    *! not adjusted for the local time zone.    *!    *! @seealso -  *! @[localtime()], @[time()], @[ctime()], @[mktime()] +  *! @[localtime()], @[time()], @[ctime()], @[mktime()], +  *! @[strptime()]    */   PMOD_EXPORT void f_gmtime(INT32 args)   {   #if defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S)    struct tm tm_s;   #endif    struct tm *tm;    INT64 tt;    time_t t;   
pike.git/src/builtin_functions.c:5599:    *!    *! An error is thrown if the localtime(2) call failed on the system.    *! It's platform dependent what time ranges that function can handle,    *! e.g. Windows doesn't handle a negative @[timestamp].    *!    *! @note    *! Prior to Pike 7.5 the field @expr{"timezone"@} was sometimes not    *! present, and was sometimes not adjusted for daylight-saving time.    *!    *! @seealso -  *! @[Calendar], @[gmtime()], @[time()], @[ctime()], @[mktime()] +  *! @[Calendar], @[gmtime()], @[time()], @[ctime()], @[mktime()], +  *! @[strptime()]    */   PMOD_EXPORT void f_localtime(INT32 args)   {    struct tm *tm;    INT64 tt;    time_t t;       get_all_args("localtime", args, "%l", &tt);      #if SIZEOF_TIME_T < SIZEOF_INT64
pike.git/src/builtin_functions.c:5758:    *!    *! On most 32-bit systems, the supported range of dates is from Dec 13, 1901    *! 20:45:52 UTC through to Jan 19, 2038 03:14:07 UTC (inclusive).    *!    *! On most 64-bit systems, the supported range of dates is expressed    *! in 56 bits and is thus practically    *! unlimited (at least up to 1141 milion years in the past    *! and into the future).    *!    *! @seealso -  *! @[time()], @[ctime()], @[localtime()], @[gmtime()] +  *! @[time()], @[ctime()], @[localtime()], @[gmtime()], @[strftime()]    */   PMOD_EXPORT void f_mktime (INT32 args)   {    struct tm date;    time_t retval;    int normalised_time, tz;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("mktime", 1);   
pike.git/src/builtin_functions.c:5877: Inside #if defined(HAVE_STRPTIME)
   *! @item %y    *! The year within century (0-99). When a century is not    *! otherwise specified, values in the range 69-99 refer to years    *! in the twentieth century (1969-1999); values in the range    *! 00-68 refer to years in the twenty-first century (2000-2068).    *!    *! @item %Y    *! The year, including century (for example, 1991).    *! @enddl    *! +  *! @seealso +  *! @[localtime()], @[gmtime()], @[strftime()]    */   PMOD_EXPORT void f_strptime (INT32 args)   {    struct tm tm;    const char* ret;    if (Pike_sp[-1].u.string->size_shift || Pike_sp[-2].u.string->size_shift)    Pike_error("Only 8bit strings are supported\n");    memset(&tm, 0, sizeof(tm));    ret = strptime(Pike_sp[-2].u.string->str, Pike_sp[-1].u.string->str, &tm);    pop_n_elems(args);    if (ret)    encode_tm_tz(&tm);    else    push_int(0);   }   #endif /* HAVE_STRPTIME */   /*! @decl string(1..255) strftime( string(1..255) format, mapping(string:int) tm) -  *! See also @[Gettext.setlocale] +     *!    *! Convert the structure to a string.    *!    *! @dl    *! @item %a    *! The abbreviated weekday name according to the current locale    *!    *! @item %A    *! The full weekday name according to the current locale.    *!
pike.git/src/builtin_functions.c:6028:    *!    *! @item %V    *! The ISO 8601 week number of the current year as a decimal number,    *! range 01 to 53, where week 1 is the first week that has at least    *! 4 days in the new year. See also @expr{%U@} and @expr{%W@}.    *!    *! @item %w    *! The day of the week as a decimal, range 0 to 6, Sunday being 0.    *! See also @expr{%u@}.    *! @enddl +  *! +  *! @seealso +  *! @[mktime()], @[strptime()], @[Gettext.setlocale]    */   PMOD_EXPORT void f_strftime (INT32 args)   {    char buffer[8192];    struct tm date;    buffer[0] = 0;       unwind_tm();    get_tm("strftime", 8, &date);    pop_n_elems(8);