• date format ideas

    From Ken Bowley@1:114/485 to All on Wed Oct 5 07:49:56 2016
    Hello everybody!

    I was talking with a friend/co-worker about the date format issue with MBSE, and he asked if we could just use standard strftime formats. This seems like an idea that would reduce much of the complication involved with this change.

    The changes to records would be a small string (6 bytes?) for the default system format, and the same for user preferences.

    Display changes would be very simple, since they could just use strftime to format the date display.

    The GetDate function in mbsebbs/input.c would need to need to understand the strftime format (or a reduced/simplified subset that includes %Y, %m, and %d), and adjust the handling of user import accordingly.

    The language files currently have the date format hardcoded for the prompts to enter dates for "Date of Birth" and for entering a date when searching files. These will need to be more flexible. Perhaps something similar to what is needed for GetDate will work for templating the date format in the language files.

    Along with these changes is having MBSE use a time_t rather than a string when possible so we can get rid of code (only two places that I can think of at the moment) that manipulates a date string into a YYYYMMDD format before turning it into an integer for comparison and sorting.

    Ken


    --- GoldED+/LNX 1.1.5-b20160827 - MBSE BBS - Debian GNU/Linux
    * Origin: The Realm of Darkness |(623)907-2858| bbs.trod.org (1:114/485)
  • From Vince Coen@2:250/1 to Ken Bowley on Wed Oct 5 16:56:28 2016
    Hello Ken!

    Wednesday October 05 2016 07:49, you wrote to All:


    Would have thought that the Linux standard date format of YYYYMMDD can be used for all. Then only convert for display subject to LC settings (sysop) or for language settings for bbs users (or there again just the LC one only).


    Unix has a date and a date/time construct in C that has been in use a very long
    time that can be used for the storage of such.

    My applications when updating all use this form and only o/p to display or pronter based on users system settings via LC_TIME.


    Vince



    Hello everybody!

    I was talking with a friend/co-worker about the date format issue with
    MBSE, and he asked if we could just use standard strftime formats.
    This seems like an idea that would reduce much of the complication
    involved with this change.

    The changes to records would be a small string (6 bytes?) for the
    default system format, and the same for user preferences.

    Display changes would be very simple, since they could just use
    strftime to format the date display.

    The GetDate function in mbsebbs/input.c would need to need to
    understand the strftime format (or a reduced/simplified subset that
    includes %Y, %m, and %d), and adjust the handling of user import accordingly.

    The language files currently have the date format hardcoded for the
    prompts to enter dates for "Date of Birth" and for entering a date
    when searching files. These will need to be more flexible. Perhaps something similar to what is needed for GetDate will work for
    templating the date format in the language files.

    Along with these changes is having MBSE use a time_t rather than a
    string when possible so we can get rid of code (only two places that I
    can think of at the moment) that manipulates a date string into a
    YYYYMMDD format before turning it into an integer for comparison and sorting.

    Ken




    Vince

    --- Mageia Linux v5/Mbse v1.0.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Ken Bowley@1:114/485 to Vince Coen on Wed Oct 5 18:52:04 2016
    On 2016-10-05 09:56:28 -0700, Vince Coen wrote to Ken Bowley:

    Would have thought that the Linux standard date format of YYYYMMDD can be
    used
    for all. Then only convert for display subject to LC settings (sysop) or for language settings for bbs users (or there again just the LC one only).

    You may be a little disappointed to learn that in the user record in MBSE sDateOfBirth is stored as a string in DD-MM-YYYY format, although other dates (tFirstLoginDate and tLastLoginDate) are stored a int32_t.

    Unix has a date and a date/time construct in C that has been in use a very long
    time that can be used for the storage of such.

    agreed.

    My applications when updating all use this form and only o/p to display or pronter based on users system settings via LC_TIME.

    Vince



    Hello everybody!

    I was talking with a friend/co-worker about the date format issue with MBSE, and he asked if we could just use standard strftime formats.
    This seems like an idea that would reduce much of the complication involved with this change.

    The changes to records would be a small string (6 bytes?) for the
    default system format, and the same for user preferences.

    Display changes would be very simple, since they could just use
    strftime to format the date display.

    The GetDate function in mbsebbs/input.c would need to need to
    understand the strftime format (or a reduced/simplified subset that includes %Y, %m, and %d), and adjust the handling of user import accordingly.

    The language files currently have the date format hardcoded for the prompts to enter dates for "Date of Birth" and for entering a date
    when searching files. These will need to be more flexible. Perhaps something similar to what is needed for GetDate will work for
    templating the date format in the language files.

    Along with these changes is having MBSE use a time_t rather than a
    string when possible so we can get rid of code (only two places that I
    can think of at the moment) that manipulates a date string into a
    YYYYMMDD format before turning it into an integer for comparison and sorting.

    Ken




    Vince

    --- Mageia Linux v5/Mbse v1.0.6/GoldED+/LNX 1.1.501-b20150715
    + Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)


    --- Ken's Ruby JAM reader (jamlib 0.1.4)
    * Origin: The Realm of Darkness |(623)907-2858| bbs.trod.org (1:114/485)
  • From Vince Coen@2:250/1 to Ken Bowley on Thu Oct 6 18:42:00 2016
    Hello Ken!

    Wednesday October 05 2016 18:52, you wrote to me:

    On 2016-10-05 09:56:28 -0700, Vince Coen wrote to Ken Bowley:

    Would have thought that the Linux standard date format of YYYYMMDD
    can be
    used
    for all. Then only convert for display subject to LC settings
    (sysop) or for language settings for bbs users (or there again just
    the LC one only).

    You may be a little disappointed to learn that in the user record in
    MBSE sDateOfBirth is stored as a string in DD-MM-YYYY format, although
    other dates (tFirstLoginDate and tLastLoginDate) are stored a int32_t.

    Load of space for the unix C construct as it is stored in binary.

    Unix has a date and a date/time construct in C that has been in use
    a very long time that can be used for the storage of such.

    agreed.

    My applications when updating all use this form and only o/p to
    display or pronter based on users system settings via LC_TIME.






    Vince

    --- Mageia Linux v5/Mbse v1.0.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Ken Bowley@1:114/485 to Vince Coen on Thu Oct 6 19:56:13 2016
    On 2016-10-06 11:42:00 -0700, Vince Coen wrote to Ken Bowley:

    (^--- side note to self, adjust for senders TZ)

    You may be a little disappointed to learn that in the user record in
    MBSE sDateOfBirth is stored as a string in DD-MM-YYYY format, although other dates (tFirstLoginDate and tLastLoginDate) are stored a int32_t.

    Load of space for the unix C construct as it is stored in binary.

    But is 12 bytes enough to store the time construct AND LC_TIME information?

    Ken

    --- Ken's Ruby JAM reader (jamlib 0.1.4)
    * Origin: The Realm of Darkness |(623)907-2858| bbs.trod.org (1:114/485)
  • From Vince Coen@2:250/1 to Ken Bowley on Fri Oct 7 23:59:00 2016
    Hello Ken!

    Thursday October 06 2016 19:56, you wrote to me:

    On 2016-10-06 11:42:00 -0700, Vince Coen wrote to Ken Bowley:

    (^--- side note to self, adjust for senders TZ)

    You may be a little disappointed to learn that in the user record
    in
    MBSE sDateOfBirth is stored as a string in DD-MM-YYYY format,
    although
    other dates (tFirstLoginDate and tLastLoginDate) are stored a
    int32_t.

    Load of space for the unix C construct as it is stored in binary.

    But is 12 bytes enough to store the time construct AND LC_TIME
    information?

    12 might be a tad tight :

    How ever for the date only more than enough the time stamp go some where else




    Vince

    --- Mageia Linux v5/Mbse v1.0.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Phil Taylor@1:275/201 to KEN BOWLEY on Sat Oct 8 21:40:11 2016


    Along with these changes is having MBSE use a time_t rather than a
    string when possible so we can get rid of code (only two places that I can think of at the moment) that manipulates a date string into a YYYYMMDD format before turning it into an integer for comparison and sorting.
    Ken

    All the programming lanuages support a date lib that allows you to compare
    the dates as mm-dd-year.

    ... Backup not found: (A)bort (R)etry (S)lap nearest innocent bystander.

    ___ Blue Wave/QWK v2.20

    --- Mystic BBS/QWK v1.12 A30 (Windows)
    * Origin: Mystic.dynu.net 2310 (1:275/201)
  • From Vince Coen@2:250/1 to Phil Taylor on Sun Oct 9 23:54:00 2016
    Hello Phil!

    Saturday October 08 2016 21:40, you wrote to KEN BOWLEY:



    Along with these changes is having MBSE use a time_t rather than
    a string when possible so we can get rid of code (only two
    places that I can think of at the moment) that manipulates a
    date string into a
    YYYYMMDD format before turning it into an integer for comparison
    and sorting. Ken

    All the programming lanuages support a date lib that allows you to
    compare the dates as mm-dd-year.

    Yes, but the best way of comparing is by yyyymmdd and then you can use a simple
    if date-1 > date-2 then . . . .




    Vince

    --- Mageia Linux v5/Mbse v1.0.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)