Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:43:48+00:00 2026-06-09T06:43:48+00:00

I have a Windows Service that runs on my Texas origin Server Central Time.

  • 0

I have a Windows Service that runs on my

Texas origin Server Central Time.

This will check for all active reminders and compares the reminder time that user wants and send out reminder if it matches with user required time.

Scenarios

  1. User is from EST
  2. User set up a reminder for *1:25 PM * using UI via my website
  3. On submit, my C# business logic converts this time to UTC before storing in my database. That will become ’18:25:00′
  4. My Business logic will pull all Active reminders from DB
  5. And checks for reminder time if current UTC time and Reminder setup time diffrence is less then 5 mins, then it will send notification to that customer.

this is how my logic written

 DateTime CurrentDate = DateTime.Now.ToUniversalTime();
 TimeSpan currentTime = DateTime.Now.ToUniversalTime().TimeOfDay;

 if (Reminder.DailyReminders.Any(x => currentTime.Subtract(x.ReminderTime).TotalMinutes < 5 
&& currentTime.Subtract(x.ReminderTime).TotalMinutes > 0))
    {
        if (Reminder.ReminderMedhodID.Equals(1))
        _email.ComposeEmail(Reminder);
    }

My Problem is
*currentTime* is always 1 hour behind to user requested reminder time SO my reminders are going out 1 hour late.

Note : currentTime is from below

TimeSpan currentTime = DateTime.Now.ToUniversalTime().TimeOfDay;

I am not sure if this is the best way to handle this requirement. considering this is one of the way, can any on help how to fix this issue?

Thanks to peter’s answer

Can any one help me how to take user input time with Daylight consideration

This what i have so far

public TimeSpan ConvertToUTCTime(string dateStr)
        {
            DateTime localDateTime = DateTime.Parse(dateStr); // Local .NET timeZone.
            DateTime utcDateTime = localDateTime.ToUniversalTime();

            string clTimeZoneKey = TimeZone.CurrentTimeZone.StandardName;
            TimeZoneInfo clTimeZone = TimeZoneInfo.FindSystemTimeZoneById(clTimeZoneKey);
            DateTime clDateTime = TimeZoneInfo.ConvertTimeFromUtc(utcDateTime, clTimeZone);
            if (clTimeZone.IsDaylightSavingTime(localDateTime))
            {
                // Get DayLight local time in UTC
                // Yet to be implemented
            }
            return clDateTime.TimeOfDay;
        }

I got this worked using this
http://msdn.microsoft.com/en-us/library/system.globalization.daylighttime.aspx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:43:50+00:00Added an answer on June 9, 2026 at 6:43 am

    Ummm…we are currently using Daylight Saving Time in most of the U.S. (though there are some portions of Indiana that did/do use EST?) Since EDT is one hour ahead of EST, your logic is correct. It is the input (EST) that is incorrect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows service that runs every 10 seconds ... each time it
I have a C# .NET service that runs as DOMAIN\username on a windows server
I have a server written in Java that runs as a Windows service (thanks
I have a Windows service that runs as a logged-in user (local admin). During
i have a windows service that runs every 10 seconds to execute the read
I have a windows service that do something periodically. on user account runs systray
I have an application that runs as a Windows service. It stores various things
I have a windows service that runs at 5 PM everyday. Once it starts
I have a Windows Service that runs a Team City Build agent on a
I have developed an app that runs as a windows service and regularly does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.