Assuming that by 'epoch time' you mean time_t, you don't need to convert to some other form. Since time_t is a lying liar and pretends every day is exactly 86400 seconds long, you can just do some /'s and %'s to find which fit in the same day and the highest for the day.
(of course, because of the undefined behavior around leap seconds, you can't really be sure whether % 86_400 == 0 is actually 00:00:00 or 23:59:60, but I think most systems repeat the 86399th instead. And since you can't tell anyway, it probably doesn't matter)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|