user58373: Can anyone provide a sample code that would convert a human readable date like 2019-10-27 22:10:35 to a unix timestamp like 1572214235?
I found many topics about it, but they eider refer to out of date libraries, or they seem to address more complex time functions, I find it hard to extract this functionality from them. 

user4143: If you have a fixed format you can use strtok() to slice the string into individual segments, then convert those segments to integers. They can then be used with TimeLib.h with the setTime() function.  You can then query TimeLib for the unix timestamp with now().
Edit: using PaulStoffregen's TimeLib, this code sets current time and returns current unix timestamp.
#include <TimeLib.h>

void setup() {
  Serial.begin(9600);

  // hour, min, sec, day, month, year
  setTime(22, 30, 11, 29, 3, 2019);

  // 1553898611
  Serial.println(now());
}
void loop() {}

Edit 2: And to convert any given date to a unix timestamp (without setting current time):
#include "TimeLib.h"

tmElements_t my_time;  // time elements structure
time_t unix_timestamp; // a timestamp

void setup() {
  Serial.begin(9600);

  // convert a date and time into unix time, offset 1970
  my_time.Second = 0;
  my_time.Hour = 23;
  my_time.Minute = 0;
  my_time.Day = 25;
  my_time.Month = 3 - 1;      // months start from 0, so deduct 1
  my_time.Year = 2017 - 1970; // years since 1970, so deduct 1970

  unix_timestamp =  makeTime(my_time);
  Serial.println(unix_timestamp);
}

void loop() {}


user60335: After parsing the time into numbers, you can use the standard C time library time.h. More specifically, use the mktime function to convert a struct tm into a time_t, and use difftime to get the seconds since the start of the Unix expoch:
#include <time.h>

void loop() {
    struct tm ltm = {0};
    ltm.tm_year = 2019 - 1900;
    ltm.tm_mon  = 11 - 1;
    ltm.tm_mday = 5;

    int32_t epoch_seconds = difftime(mktime(&ltm), (time_t)0);
    Serial.print("Remember, remember, ");
    Serial.print(epoch_seconds);
}

Note that in struct tm, the year starts at 1900 and the month starts at 0.
EDIT: In avr-libc, difftime returns an int32_t, not a double.

58373: <p>Can anyone provide a sample code that would convert a human readable date like <code>2019-10-27 22:10:35</code> to a unix timestamp like <code>1572214235</code>?</p>

<p>I found many topics about it, but they eider refer to out of date libraries, or they seem to address more complex time functions, I find it hard to extract this functionality from them. </p>
 4143: <p>If you have a fixed format you can use <code>strtok()</code> to slice the string into individual segments, then convert those segments to integers. They can then be used with <code>TimeLib.h</code> with the <code>setTime()</code> function.  You can then query TimeLib for the unix timestamp with <code>now()</code>.</p>

<p><strong>Edit:</strong> using <a href="https://github.com/PaulStoffregen/Time" rel="nofollow noreferrer">PaulStoffregen's TimeLib</a>, this code sets current time and returns current unix timestamp.</p>

<pre><code>#include &lt;TimeLib.h&gt;

void setup() {
  Serial.begin(9600);

  // hour, min, sec, day, month, year
  setTime(22, 30, 11, 29, 3, 2019);

  // 1553898611
  Serial.println(now());
}
void loop() {}
</code></pre>

<p><strong>Edit 2:</strong> And to convert <strong>any</strong> given date to a unix timestamp (without setting current time):</p>

<pre><code>#include "TimeLib.h"

tmElements_t my_time;  // time elements structure
time_t unix_timestamp; // a timestamp

void setup() {
  Serial.begin(9600);

  // convert a date and time into unix time, offset 1970
  my_time.Second = 0;
  my_time.Hour = 23;
  my_time.Minute = 0;
  my_time.Day = 25;
  my_time.Month = 3 - 1;      // months start from 0, so deduct 1
  my_time.Year = 2017 - 1970; // years since 1970, so deduct 1970

  unix_timestamp =  makeTime(my_time);
  Serial.println(unix_timestamp);
}

void loop() {}
</code></pre>
 60335: <p>After parsing the time into numbers, you can use the standard C time library <code>time.h</code>. More specifically, use the <code>mktime</code> <a href="https://en.cppreference.com/w/c/chrono/mktime" rel="nofollow noreferrer">function</a> to convert a <code>struct tm</code> into a <code>time_t</code>, and use <code>difftime</code> to get the seconds since the start of the Unix expoch:</p>
<pre><code>#include &lt;time.h&gt;

void loop() {
    struct tm ltm = {0};
    ltm.tm_year = 2019 - 1900;
    ltm.tm_mon  = 11 - 1;
    ltm.tm_mday = 5;

    int32_t epoch_seconds = difftime(mktime(&amp;ltm), (time_t)0);
    Serial.print(&quot;Remember, remember, &quot;);
    Serial.print(epoch_seconds);
}
</code></pre>
<p>Note that in <code>struct tm</code>, the year starts at 1900 and the month starts at 0.</p>
<p>EDIT: In avr-libc, <code>difftime</code> returns an <code>int32_t</code>, not a <code>double</code>.</p>
