title: In ASP.NET Core 3.1, how can I schedule a background task (Cron Jobs) with hosted services for a specific date and time in the future?
body: <p>I am working on a project based on ASP.NET Core 3.1 and I want to add a specific functionality to it to schedule publishing a post in the future in a date and time specified by post author (something like what Wordpress does for scheduled posts through its cron jobs). For example, if we receive this date and time from user :</p>
  <p><strong>2020-09-07 14:08:07</strong></p>
  <p>Then, how can I schedule a background task for it by using hosted services to run only for one time and to change a flag in database and save changes after that?</p>
  <p>I've read some articles about it but they didn't specify date and time and just mentioned repeated tasks for every 5 second and stuff like that with cron expressions, but, the thing I need to know is how can I <strong>schedule a background task for a specific date and time?</strong></p>
  <p>Thank you in advance.</p>