• Re: strptime()

    From root@NoEMail@home.org to alt.os.linux.slackware on Thu Dec 5 17:51:14 2024
    From Newsgroup: alt.os.linux.slackware

    root <NoEMail@home.org> wrote:
    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime()
    which gcc on Slackware 15.0 does not recognize. My version
    of gcc is gcc version 11.2.0 (GCC). I don't have an installation
    with current so I can't check if a later version of gcc will
    work. Anyone here use strptime?
    Thanks.

    Don't bother with this. I found a solution that does not use
    strptime(). ChatGPT gave me the programs.

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Henrik Carlqvist@Henrik.Carlqvist@deadspam.com to alt.os.linux.slackware on Thu Dec 5 17:54:30 2024
    From Newsgroup: alt.os.linux.slackware

    On Thu, 05 Dec 2024 17:30:46 +0000, root wrote:

    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime() which
    gcc on Slackware 15.0 does not recognize.

    At least Slackware 15.0 has a man page for strptime. Did you try to

    #define _XOPEN_SOURCE

    before your

    #include <time.h>

    ?

    regards Henrik
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lew Pitcher@lew.pitcher@digitalfreehold.ca to alt.os.linux.slackware on Thu Dec 5 19:07:59 2024
    From Newsgroup: alt.os.linux.slackware

    On Thu, 05 Dec 2024 19:00:02 +0100, Giovanni wrote:

    On 12/5/24 18:30, root wrote:
    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime()
    which gcc on Slackware 15.0 does not recognize. My version
    of gcc is gcc version 11.2.0 (GCC). I don't have an installation
    with current so I can't check if a later version of gcc will
    work. Anyone here use strptime?
    Thanks.

    I never used it but but I see that is included in the standard library.
    Did you try "man strptime"?

    He didn't bother. He's just a code monkey, copying code "written" by a
    Large Language Model, and doesn't really know what he's doing.
    --
    Lew Pitcher
    "In Skills We Trust"
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From root@NoEMail@home.org to alt.os.linux.slackware on Fri Dec 6 03:51:17 2024
    From Newsgroup: alt.os.linux.slackware

    Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> wrote:
    On Thu, 05 Dec 2024 17:30:46 +0000, root wrote:

    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime() which
    gcc on Slackware 15.0 does not recognize.

    At least Slackware 15.0 has a man page for strptime. Did you try to

    #define _XOPEN_SOURCE

    before your

    #include <time.h>

    ?

    regards Henrik

    Thanks for responding Henrik. No, I know know nothing
    about _XOPEN_SOURCE.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From root@NoEMail@home.org to alt.os.linux.slackware on Fri Dec 6 03:53:08 2024
    From Newsgroup: alt.os.linux.slackware

    Giovanni <lsodgf0@home.net.it> wrote:
    On 12/5/24 18:30, root wrote:
    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime()
    which gcc on Slackware 15.0 does not recognize. My version
    of gcc is gcc version 11.2.0 (GCC). I don't have an installation
    with current so I can't check if a later version of gcc will
    work. Anyone here use strptime?
    Thanks.

    I never used it but but I see that is included in the standard library.
    Did you try "man strptime"?

    Ciao
    Giovanni

    I never thought to do man strptime. Right at the top
    it gives the XOPEN thing. I was trying various
    lib things.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From root@NoEMail@home.org to alt.os.linux.slackware on Fri Dec 6 03:59:32 2024
    From Newsgroup: alt.os.linux.slackware

    Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
    On Thu, 05 Dec 2024 19:00:02 +0100, Giovanni wrote:

    On 12/5/24 18:30, root wrote:
    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime()
    which gcc on Slackware 15.0 does not recognize. My version
    of gcc is gcc version 11.2.0 (GCC). I don't have an installation
    with current so I can't check if a later version of gcc will
    work. Anyone here use strptime?
    Thanks.

    I never used it but but I see that is included in the standard library.
    Did you try "man strptime"?

    He didn't bother. He's just a code monkey, copying code "written" by a
    Large Language Model, and doesn't really know what he's doing.




    It sure seems lile that, but I have been coding for seventy years.
    I am working on a larger project and needed to pop back and
    forth between different date formats including seconds from
    epoch. I saw two options: 1) could try to work out the
    details myself, 2) I could use popen and pass the problem
    to a system call. I wanted to do it faster than either
    1 or 2, so I thought I would give an AI a chance to
    help. Try it yourself sometime.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Rich@rich@example.invalid to alt.os.linux.slackware on Fri Dec 6 18:02:04 2024
    From Newsgroup: alt.os.linux.slackware

    root <NoEMail@home.org> wrote:
    Giovanni <lsodgf0@home.net.it> wrote:
    On 12/5/24 18:30, root wrote:
    I asked Gemini to give me a c program to convert date format to epoch
    time and conversely. It provided a program that uses strptime()
    which gcc on Slackware 15.0 does not recognize. My version
    of gcc is gcc version 11.2.0 (GCC). I don't have an installation
    with current so I can't check if a later version of gcc will
    work. Anyone here use strptime?
    Thanks.

    I never used it but but I see that is included in the standard library.
    Did you try "man strptime"?

    Ciao
    Giovanni

    I never thought to do man strptime. Right at the top
    it gives the XOPEN thing. I was trying various
    lib things.

    When encountering something on a Linux machine (esp. a library
    function) for which you are unfamiliar, your very first thought should *always* be: "lets check for a man page".

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From root@NoEMail@home.org to alt.os.linux.slackware on Fri Dec 6 20:48:43 2024
    From Newsgroup: alt.os.linux.slackware

    Rich <rich@example.invalid> wrote:
    When encountering something on a Linux machine (esp. a library
    function) for which you are unfamiliar, your very first thought should *always* be: "lets check for a man page".


    It will be my first step from now on. Thanks for responding.
    --- Synchronet 3.21d-Linux NewsLink 1.2