Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6352975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:19:44+00:00 2026-05-24T22:19:44+00:00

http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/usr.bin/tar/Attic/getdate.y?rev=1.9.12.1;content-type=text%2Fplain;hideattic=0 I am trying to understand how yyTimezone is calculated in code below: |

  • 0

http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/usr.bin/tar/Attic/getdate.y?rev=1.9.12.1;content-type=text%2Fplain;hideattic=0

I am trying to understand how yyTimezone is calculated in code below:

| bare_time  '+' tUNUMBER {
    /* "7:14+0700" */
    yyDSTmode = DSToff;
    yyTimezone = - ($3 % 100 + ($3 / 100) * 60);
}
| bare_time '-' tUNUMBER {
    /* "19:14:12-0530" */
    yyDSTmode = DSToff;
    yyTimezone = + ($3 % 100 + ($3 / 100) * 60);
}

How I understand is, lets say the timestamp is 2011-01-02T10:15:20-04:00; this means its 0400 hours behind UTC. So to convert it into UTC, you add 0400 hours to it and it becomes 2011-01-02T14:15:20. Is my understanding correct?

How is that achieved in the codeblock I pasted above?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:19:45+00:00Added an answer on May 24, 2026 at 10:19 pm

    The input would encode the offset like -0400. The 0400 part of that would be returned as the tUNUMBER token (presumably holding an unsigned value). This token is matched by the grammar rules, and can be used as $3.

    To get the actual offset in minutes from the value 400, you first have to split it up in two halves. The hours part can be obtained with $3 / 100 (ie. 4), and the minutes part with $3 % 100 (ie. 0). Since there are 60 minutes in an hour, you multiply the hours by 60, and add the minutes to that ($3 % 100 + ($3 / 100) * 60), which would give the value 240. Then all that’s left, is to add the sign, and store it in yyTimezone.

    After all that, yyTimezone will contain the timezone offset in minutes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/tar/lib/Attic/getdate.c?hideattic=0 Revision 1.2 Fri Sep 15 08:04:20 2006 UTC (4 years, 11 months ago)
http://www.elasticsearch.org/guide/reference/index-modules/analysis/standard-analyzer.html I have to use standard analyzer during indexing with custom stopwords . How
http://www.sqlite.org/threadsafe.html From above link I came to know, SQLite support three different threading modes
http://www.validome.org/xml/validate/?lang=en&viewSourceCode=1&url=http://45143.com/finance-feed/abc.xml&onlyWellFormed=1 check the url above for validator results. Line 171 in the XSD is
http://www.boost.org/doc/libs/1_35_0/doc/html/boost/get_id405862.html template<typename U, typename T1, typename T2, ..., typename TN> U & get(variant<T1, T2,
http://www.boost.org/boost-build2/doc/html/bbv2/installation.html Tried following those instructions, but they do not work. What I did: Open
http://www.mamstore.co.uk/bin/pxisapi1.exe/catalogue?level=805838 Look where its (meant to say) £5 T-shirts. Instead the '£' comes up
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=759 >> read http://www.informit.com/guides/content.aspx?g=dotnet&s eqNum=759 connecting to: www.informit.com ** User Error: HTTP forwarding error:
http://www.colorz.fr/#!/en/work/ I love how they show/hide the content based on clicking on the thumbnails,
http://www.chai3d.org/doc/classc_camera.html#6b5bbcc535b601c19e10be288dfc65f7 for bool cCamera::set ( const cVector3d & a_localPosition, const cVector3d & a_localLookAt, const

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.