Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.advocacy > #412973

Re: Response Challenge to the Dumb-Fuck Shill (DFS)

From "F. Russell" <fr@random.info>
Newsgroups comp.os.linux.advocacy
Subject Re: Response Challenge to the Dumb-Fuck Shill (DFS)
Date 2017-05-05 00:02 +0000
Organization NewsGuy - Unlimited Usenet $23.95
Message-ID <oegfef012l5@news3.newsguy.com> (permalink)
References <oeg1ak0160l@news6.newsguy.com> <oeg5910boc@news7.newsguy.com> <oegd5k$27u$1@dont-email.me> <oegdoi011v0@news3.newsguy.com>

Show all headers | View raw


On Thu, 04 May 2017 23:33:38 +0000, F. Russell wrote:

> 
> Then modify your little code to accept dates in the format
> "On day DD in the month of MONTH of the year YYYY"
> and return the date of the following Sunday.
>

Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

Hmmm ... I think he may be having some problems.

Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

Yes, read the date in that long string format and then
output next Sunday's date in the SAME format.

Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

I think he'll remain stymied.

Well, try my wonderful C function.  It will input a date
in ANY imaginable format and then output the date of the
following Sunday in ANY imaginable format.

All in three lines to boot.

==============================================================
Begin C Function
==============================================================
#define _XOPEN_SOURCE
#include <time.h>
#include <string.h>

void convert_date(char *date_to_convert, char *fmtin, char *fmtout, size_t maxout, char *converted_date)
{
time_t curr, diff;
struct tm curr_date;

memset(&curr_date, 0, sizeof curr_date);
strptime(date_to_convert, fmtin, &curr_date);
diff=(time_t)((curr_date.tm_wday==0?0:(7-curr_date.tm_wday)*86400))+mktime(&curr_date);
strftime(converted_date, maxout, fmtout, localtime(&diff));
}

================================================================
End C Function
================================================================

This is a C function.  It is NOT a stand-alone program.

It uses GNU gibc, the best C library in the world.

Back to comp.os.linux.advocacy | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-04 20:01 +0000
  Re: Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-04 21:08 +0000
    Re: Response Challenge to the Dumb-Fuck Shill (DFS) DFS <nospam@dfs.com> - 2017-05-04 19:26 -0400
      Re: Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-04 23:33 +0000
        Re: Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-05 00:02 +0000
          Re: Response Challenge to the Dumb-Fuck Shill (DFS) DFS <nospam@dfs.com> - 2017-05-04 22:03 -0400
            Re: Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-05 08:30 +0000
            Re: Response Challenge to the Dumb-Fuck Shill (DFS) DFS <nospam@dfs.com> - 2017-05-05 14:59 -0400
  Re: Response Challenge to the Dumb-Fuck Shill (DFS) DFS <nospam@dfs.com> - 2017-05-04 18:47 -0400
    Re: Response Challenge to the Dumb-Fuck Shill (DFS) "F. Russell" <fr@random.info> - 2017-05-04 23:06 +0000

csiph-web