linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J." <mailing-lists@xs4all.nl>
To: linux-c-programming@vger.kernel.org
Subject: RE: <time.h>: solved thank you ....
Date: Fri, 9 May 2003 21:46:48 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0305092142410.13952-100000@hestia> (raw)
In-Reply-To: <EF836A380096D511AD9000B0D021B52701317B4A@narmada.techmas.hcltech.com>

On Fri, 9 May 2003, Ranga Reddy M - CTD ,Chennai. wrote:
> 
> Hi,
> 
> Here you are comparing the gmtime() output to The "date" command.
> 
> see the man pages of gmtime().This will give you the time in UTC format.
> use localtime(). Gives same as your "date" output.
> 
> I have modified your code .Know it gives the 
> The code below.
> 
> #include <stdio.h>
> #include <time.h>
> 
> int main(void) {
>  struct tm *tm_ptr;
>  time_t the_time;
> 
>  (void)time(&the_time);
>  tm_ptr = localtime(&the_time);
> 
>  printf("tm_ptr->tm_hour = %d\n", tm_ptr->tm_hour);
> 
>  return 0;
> }
> 
> Cheers
> --------
> Ranga Reddy M

Thank you for the complete reply ! 

I understand what I did wrong, and how to do it better next time.

Merci....

J.


      reply	other threads:[~2003-05-09 19:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  2:56 <time.h>: gmtime keeps giving the same time Ranga Reddy M - CTD ,Chennai.
2003-05-09 19:46 ` J. [this message]

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=Pine.LNX.4.21.0305092142410.13952-100000@hestia \
    --to=mailing-lists@xs4all.nl \
    --cc=linux-c-programming@vger.kernel.org \
    /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).