linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Miguel Ferreira Rocha <luciano@lsd.di.uminho.pt>
To: "J." <mailing-lists@xs4all.nl>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: convert time to UTC, strptime() returns -1 ?
Date: Fri, 3 Oct 2003 23:28:30 +0100	[thread overview]
Message-ID: <20031003222830.GA6059@lsd.di.uminho.pt> (raw)
In-Reply-To: <Pine.LNX.4.21.0310012128140.21094-100000@hestia>

On Wed, Oct 01, 2003 at 09:40:44PM +0200, J. wrote:
>  if(strptime(tstr, "%a %b %d %T %Ey", &timestruct) == 0)
                                  ^^^^
You should use %Y, %y or %EY. For %Ey, the number is an offset from %EC,
that in my current locale is 1900.

So the year is ending up in 3903, beyond the 32/31 bit limit for the
number of seconds from Jan 1 1970.

Regards,
Luciano Rocha

  reply	other threads:[~2003-10-03 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-26 15:43 undefined reference to `_fxstat' rgomez
2003-10-01 19:40 ` convert time to UTC, strptime() returns -1 ? J.
2003-10-03 22:28   ` Luciano Miguel Ferreira Rocha [this message]
2003-10-06 21:02     ` convert time to UTC, THNKX ... solved J.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031003222830.GA6059@lsd.di.uminho.pt \
    --to=luciano@lsd.di.uminho.pt \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mailing-lists@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).