Find the answer to your Linux question:
Results 1 to 2 of 2
i am using fc3 OS i am writing a C application to first change timezone by creating link to respective timzone zonefile, then set time(time is input by user ) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    1

    problem with DST TIMEZONES, NE HELP???????


    i am using fc3 OS
    i am writing a C application to first change timezone by creating link to respective timzone zonefile, then set time(time is input by user ) by first converting it to time since epoch by mktime() API then set time by settimeofday(). i am facing issues with timezones which have DST on like America/New_York. if i set time 5:00 with any America/New_York timezone then actual fetched on gettimeofday() and then converting using localtime_r() gives me 6:00. i suspect some DST correction is getting applied ? any clue how to avoid this?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    "date" already does everything you describe.
    My suggestion is to use it.

    If you want to reimplement this tool, then get the source or devel package of "coreutils" and study the code.

    Other than that: fc3 is from 2004. It is highly advised to update.
    Last edited by Irithori; 06-17-2012 at 09:43 AM.
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •