Добро пожаловать, Гость. Пожалуйста авторизуйтесь здесь.
FGHIGate на GaNJa NeTWoRK ST@Ti0N - Просмотр сообщения в эхоконференции FTSC_PUBLIC
Введите FGHI ссылку:


Присутствуют сообщения из эхоконференции FTSC_PUBLIC с датами от 13 Sep 13 18:57:24 до 15 Nov 24 00:30:01, всего сообщений: 7128
Ответить на сообщение К списку сообщений Предыдущее сообщение Следующее сообщение
= Сообщение: 5508 из 7128 ====================================== FTSC_PUBLIC =
От   : Rob Swindell                     1:103/705          13 Feb 21 14:13:31
Кому : Maurice Kinal                                       13 Feb 21 14:13:31
Тема : "Packet Type 2 Compatible Formats" (Ex FSP-1040)
FGHI : area://FTSC_PUBLIC?msgid=30962.ftsc_pub@1:103/705+248dfdfd
На   : area://FTSC_PUBLIC?msgid=1:153/7001+60283f88
= Кодировка сообщения определена как: ASCII ==================================
==============================================================================
  Re: "Packet Type 2 Compatible Formats" (Ex FSP-1040)
  By: Maurice Kinal to Rob Swindell on Sat Feb 13 2021 09:07 pm

> -={ 2021-02-13 21:07:20.634530056+00:00 }=-
>
> Hey Rob!
>
>  RS> The month field being discussed here is from the packet header,
>  RS> which is binary (not a string of text).
>
> And exactly where was it called from?

Huh?

> I am guessing localtime() which explains the resulting 0-11 reported.

It's not uncommon for January to represented as a 0. This allows for logical indexing into an array of strings (where "Jan" or "January" would be the first, or 0th, item in the array). This design is not specific to the C runtime localtime() function:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth

> Same can be said for other sources of
> localtime() such as perl, python, etc.  They are all based on time.h.
>
> Where is your software getting the date and time from?

It depends on the context, but usually from time(). When SBBSecho exports to FTN "packed messages", it uses localtime() to convert the stored time_t to a struct tm and then I use sprintf to format into the standard DateTime field syntax.

#define TM_YEAR(yy)             ((yy)%100)
    time_t tt = msg.hdr.when_written.time;
    struct tm* tm;
    if((tm = localtime(&tt)) != NULL)
        sprintf(hdr.time,"%02u %3.3s %02u  %02u:%02u:%02u"
            ,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
            ,tm->tm_hour,tm->tm_min,tm->tm_sec);

>  RS> The date field you're referring to is in a "packed message"
>  RS> header. The *year* field of the packet header is already 16-bits,
>  RS> so can already accomodate years up to 65535.
>
> Understood but I was just using that as an example that the two digit year
> used in packed message header didn't need to be a two digit year which is
> contained in the string output for the DateTime field.  In other words the
> format was bogus given that fact and could eaily be the cause of the poorly
> designed and deployed fts-4008 aka TZUTC.

You could sum up the vast majority of FidoNet in those two words: "poorly
designed". I guess we shouldn't really have expected more from technology developed by amateurs. There was plenty of higher quality "prior art" available at the time to learn or copy from, but those earlier Fido-pioneers thought they were the first ones to invent this particular kind of wheel.
--- SBBSecho 3.12-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

К главной странице гейта
Powered by NoSFeRaTU`s FGHIGate
Открытие страницы: 0.054341 секунды