Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

timediff c program - gpl

mrflash818 (226638) writes | more than 2 years ago

User Journal 2

Wrote a little c program to do command line calculation of the number of days between two dates, and respecting Gregorian calendar leap-year.

Hope others might find it useful as I do.

http://mrflash818.geophile.net/php/clang/index.php

Wrote a little c program to do command line calculation of the number of days between two dates, and respecting Gregorian calendar leap-year.

Hope others might find it useful as I do.

http://mrflash818.geophile.net/php/clang/index.php

cancel ×

2 comments

Sorry! There are no comments related to the filter you selected.

Reinventing the Wheel (0)

Anonymous Coward | more than 2 years ago | (#37747086)

Use gnu date to do all the heavy lifting and it boils down to about 25 lines of shell script.

http://www.unix.com/tips-tutorials/31944-simple-date-time-calulation-bash.html [unix.com]

Re:Reinventing the Wheel (1)

mrflash818 (226638) | more than 2 years ago | (#37747780)

Use gnu date to do all the heavy lifting and it boils down to about 25 lines of shell script.

Thanks for the comment.

gnu date, as far as I can see with a quick glance, is *nix only.

What I wrote is pure c, using std c libraries, and therefore should work in any OS.

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>