Branch: Tag:

2003-10-06

2003-10-06 12:07:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed bug in iso8601_date_time().

Rev: server/etc/modules/Roxen.pmod:1.162

1:   // This is a roxen pike module. Copyright © 1999 - 2001, Roxen IS.   // - // $Id: Roxen.pmod,v 1.161 2003/07/15 08:50:46 anders Exp $ + // $Id: Roxen.pmod,v 1.162 2003/10/06 12:07:34 grubba Exp $      #include <roxen.h>   #include <config.h>
470:      //! Returns a timestamp formatted according to ISO 8601 Date and Time   //! RFC 2518 23.2. No fraction, UTC only. - string iso8601_date_time(int ts) + string iso8601_date_time(int ts, int|void ns)   {    mapping(string:int) gmt = gmtime(ts); -  +  if (zero_type(ns)) {    return sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ", -  1900 + gmt->year, gmt->mon, gmt->mday, +  1900 + gmt->year, gmt->mon+1, gmt->mday,    gmt->hour, gmt->min, gmt->sec);    } -  +  return sprintf("%04d-%02d-%02dT%02d:%02d:%02d.%09dZ", +  1900 + gmt->year, gmt->mon+1, gmt->mday, +  gmt->hour, gmt->min, gmt->sec, ts); + }      string http_encode_string(string f)   //! Encode dangerous characters in a string so that it can be used as