pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:133:    THIS->unix_time = mktime_zone( &THIS->t ); \    THIS->modified = 0; \    } \    } while(0)      #ifdef HAVE_STRPTIME    /*! @decl int(0..1) strptime( string(1..255) format, string(1..255) data )    *!    *! Parse the given @[data] using the format in @[format] as a date.    *! -  *! %% The % character. +  *! @dl +  *! @item %% +  *! The % character.    *! -  *! %a or %A -  *! The weekday name according to the C locale, in abbreviated -  *! form or the full name. +  *! @item %a or %A +  *! The weekday name according to the C locale, in abbreviated +  *! form or the full name.    *! -  *! %b or %B or %h -  *! The month name according to the C locale, in abbreviated form -  *! or the full name. +  *! @item %b or %B or %h +  *! The month name according to the C locale, in abbreviated form +  *! or the full name.    *! -  *! %c The date and time representation for the C locale. +  *! @item %c +  *! The date and time representation for the C locale.    *! -  *! %C The century number (0-99). +  *! @item %C +  *! The century number (0-99).    *! -  *! %d or %e -  *! The day of month (1-31). +  *! @item %d or %e +  *! The day of month (1-31).    *! -  *! %D Equivalent to %m/%d/%y. +  *! @item %D +  *! Equivalent to %m/%d/%y.    *! -  *! %H The hour (0-23). +  *! @item %H +  *! The hour (0-23).    *! -  *! %I The hour on a 12-hour clock (1-12). +  *! @item %I +  *! The hour on a 12-hour clock (1-12).    *! -  *! %j The day number in the year (1-366). +  *! @item %j +  *! The day number in the year (1-366).    *! -  *! %m The month number (1-12). +  *! @item %m +  *! The month number (1-12).    *! -  *! %M The minute (0-59). +  *! @item %M +  *! The minute (0-59).    *! -  *! %n Arbitrary whitespace. +  *! @item %n +  *! Arbitrary whitespace.    *! -  *! %p The C locale's equivalent of AM or PM. +  *! @item %p +  *! The C locale's equivalent of AM or PM.    *! -  *! %R Equivalent to %H:%M. +  *! @item %R +  *! Equivalent to %H:%M.    *! -  *! %S The second (0-60; 60 may occur for leap seconds; earlier also 61 was allowed). +  *! @item %S +  *! The second (0-60; 60 may occur for leap seconds; +  *! earlier also 61 was allowed).    *! -  *! %t Arbitrary whitespace. +  *! @item %t +  *! Arbitrary whitespace.    *! -  *! %T Equivalent to %H:%M:%S. +  *! @item %T +  *! Equivalent to %H:%M:%S.    *! -  *! %U The week number with Sunday the first day of the week (0-53). +  *! @item %U +  *! The week number with Sunday the first day of the week (0-53).    *! -  *! %w The weekday number (0-6) with Sunday = 0. +  *! @item %w +  *! The weekday number (0-6) with Sunday = 0.    *! -  *! %W The week number with Monday the first day of the week (0-53). +  *! @item %W +  *! The week number with Monday the first day of the week (0-53).    *! -  *! %x The date, using the C locale's date format. +  *! @item %x +  *! The date, using the C locale's date format.    *! -  *! %X The time, using the C locale's time format. +  *! @item %X +  *! The time, using the C locale's time format.    *! -  *! %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 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).    *! -  *! %Y The year, including century (for example, 1991). +  *! @item %Y +  *! The year, including century (for example, 1991). +  *! @enddl    *!    */    PIKEFUN int(0..1) strptime( string(1..255) format, string(1..255) data )    {    if( format->size_shift || data->size_shift )    Pike_error("Only 8bit strings are supported\n");    THIS->modified = 1;    if( strptime_zone( data->str, format->str, &THIS->t ) == NULL )    RETURN 0;    RETURN 1;    }   #endif    /*! @decl string(1..255) strftime( string(1..255) format )    *! See also @[Gettext.setlocale]    *!    *! Convert the structure to a string.    *! -  *! %a The abbreviated weekday name according to the current locale +  *! @dl +  *! @item %a +  *! The abbreviated weekday name according to the current locale    *! -  *! %A The full weekday name according to the current locale. +  *! @item %A +  *! The full weekday name according to the current locale.    *! -  *! %b The abbreviated month name according to the current locale. +  *! @item %b +  *! The abbreviated month name according to the current locale.    *! -  *! %B The full month name according to the current locale. +  *! @item %B +  *! The full month name according to the current locale.    *! -  *! %c The preferred date and time representation for the current locale. +  *! @item %c +  *! The preferred date and time representation for the current locale.    *! -  *! %C The century number (year/100) as a 2-digit integer. +  *! @item %C +  *! The century number (year/100) as a 2-digit integer.    *! -  *! %d The day of the month as a decimal number (range 01 to 31). +  *! @item %d +  *! The day of the month as a decimal number (range 01 to 31).    *! -  *! %D Equivalent to %m/%d/%y. (for Americans only. Americans should note that in other countries %d/%m/%y is rather common. This means that in international context this format is ambiguous and should not be used.) +  *! @item %D +  *! Equivalent to @expr{%m/%d/%y@}. (for Americans only. +  *! Americans should note that in other countries @expr{%d/%m/%y@} +  *! is rather common. This means that in international context +  *! this format is ambiguous and should not be used.)    *! -  *! %e Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space. +  *! @item %e +  *! Like @expr{%d@}, the day of the month as a decimal number, +  *! but a leading zero is replaced by a space.    *! -  *! %E Modifier: use alternative format, see below. +  *! @item %E +  *! Modifier: use alternative format, see below.    *! -  *! %F Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99) +  *! @item %F +  *! Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)    *! -  *! %G The ISO 8601 week-based year (see NOTES) with century as a decimal number. The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead. +  *! @item %G +  *! The ISO 8601 week-based year (see NOTES) with century as a +  *! decimal number. The 4-digit year corresponding to the ISO +  *! week number (see @expr{%V@}). This has the same format and +  *! value as @expr{%Y@}, except that if the ISO week number +  *! belongs to the previous or next year, that year is used instead.    *! -  *! %g Like %G, but without century, that is, with a 2-digit year (00-99). (TZ) +  *! @item %g +  *! Like @expr{%G@}, but without century, that is, +  *! with a 2-digit year (00-99). (TZ)    *! -  *! %h Equivalent to %b. +  *! @item %h +  *! Equivalent to %b.    *! -  *! %H The hour as a decimal number using a 24-hour clock (range 00 to 23). +  *! @item %H +  *! The hour as a decimal number using a 24-hour clock (range 00 to 23).    *! -  *! %I The hour as a decimal number using a 12-hour clock (range 01 to 12). +  *! @item %I +  *! The hour as a decimal number using a 12-hour clock (range 01 to 12).    *! -  *! %j The day of the year as a decimal number (range 001 to 366). +  *! @item %j +  *! The day of the year as a decimal number (range 001 to 366).    *! -  *! %k The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.) +  *! @item %k +  *! The hour (24-hour clock) as a decimal number (range 0 to 23); +  *! single digits are preceded by a blank. (See also @expr{%H@}.)    *! -  *! %l The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.) +  *! @item %l +  *! The hour (12-hour clock) as a decimal number (range 1 to 12); +  *! single digits are preceded by a blank. (See also @expr{%I@}.)    *! -  *! %m The month as a decimal number (range 01 to 12). +  *! @item %m +  *! The month as a decimal number (range 01 to 12).    *! -  *! %M The minute as a decimal number (range 00 to 59). +  *! @item %M +  *! The minute as a decimal number (range 00 to 59).    *! -  *! %n A newline character. (SU) +  *! @item %n +  *! A newline character. (SU)    *! -  *! %O Modifier: use alternative format, see below. (SU) +  *! @item %O +  *! Modifier: use alternative format, see below. (SU)    *! -  *! %p Either "AM" or "PM" according to the given time value, or the corresponding strings for the current locale. Noon is treated as "PM" and midnight as "AM". +  *! @item %p +  *! Either @expr{"AM"@} or @expr{"PM"@} according to the given time +  *! value, or the corresponding strings for the current locale. +  *! Noon is treated as @expr{"PM"@} and midnight as @expr{"AM"@}.    *! -  *! %P Like %p but in lowercase: "am" or "pm" or a corresponding string for the current locale. +  *! @item %P +  *! Like @expr{%p@} but in lowercase: @expr{"am"@} or @expr{"pm"@} +  *! or a corresponding string for the current locale.    *! -  *! %r The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to %I:%M:%S %p. +  *! @item %r +  *! The time in a.m. or p.m. notation. In the POSIX locale this is +  *! equivalent to @expr{%I:%M:%S %p@}.    *! -  *! %R The time in 24-hour notation (%H:%M). (SU) For a version including the seconds, see %T below. +  *! @item %R +  *! The time in 24-hour notation (@expr{%H:%M@}). (SU) +  *! For a version including the seconds, see @expr{%T@} below.    *! -  *! %s The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ) +  *! @item %s +  *! The number of seconds since the Epoch, +  *! 1970-01-01 00:00:00 +0000 (UTC). (TZ)    *! -  *! %S The second as a decimal number (range 00 to 60). (The range is up to 60 to allow for occasional leap seconds.) +  *! @item %S +  *! The second as a decimal number (range 00 to 60). +  *! (The range is up to 60 to allow for occasional leap seconds.)    *! -  *! %t A tab character. (SU) +  *! @item %t +  *! A tab character. (SU)    *! -  *! %T The time in 24-hour notation (%H:%M:%S). (SU) +  *! @item %T +  *! The time in 24-hour notation (@expr{%H:%M:%S@}). (SU)    *! -  *! %u The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w. (SU) +  *! @item %u +  *! The day of the week as a decimal, range 1 to 7, Monday being 1. +  *! See also @expr{%w@}. (SU)    *! -  *! %U The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W. +  *! @item %U +  *! The week number of the current year as a decimal number, +  *! range 00 to 53, starting with the first Sunday as the first +  *! day of week 01. See also @expr{%V@} and @expr{%W@}.    *! -  *! %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 %U and %W. +  *! @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@}.    *! -  *! %w The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u. +  *! @item %w +  *! The day of the week as a decimal, range 0 to 6, Sunday being 0. +  *! See also @expr{%u@}. +  *! @enddl    */    PIKEFUN string strftime(string(1..255) format)    {    char *buffer = xalloc( 8192 );    buffer[0] = 0;    strftime_zone( buffer, 8192, format->str, &THIS->t );    push_text( buffer );    }       /*! @decl int(0..60) sec;