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

  • Home
  • SEARCH
  • 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 6369245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:46:44+00:00 2026-05-25T00:46:44+00:00

I have a process that runs on a SQL server that is set to

  • 0

I have a process that runs on a SQL server that is set to Eastern time, when the process it completed we populate a table with the completion time. I have a view that is currently being used by multiple applications which displays the Date/Time of the process in different columns, since this is being used by other apps I can’t change the view.

The query I use to return my process data is below and the Date/Time are being converted to a varchar on the server side – so it isn’t coming to the UI as a date/time.

 SELECT CONVERT(VARCHAR(10), A2.TaskDateTime, 101) AS TaskDate,
        CONVERT(VARCHAR(5),  A2.TaskDateTime, 108) AS TaskTime
 FROM Task  AS T2
 JOIN Application_Task AS A2    
  ON A2.TaskID = T2.TaskID

This data is then being displayed in the UI via a datagridview. I am trying to format the time column in a DataGridView to my local time zone because the users will be in different time zones.

I have looked at DataGridViewCellStyle.Format and search SO and found this on converting to local time but that is parsing one string. I can’t seem to figure out how to apply that to the entire column of data.

I would appreciate any help and/or direction on where to begin with this.

  • 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-05-25T00:46:46+00:00Added an answer on May 25, 2026 at 12:46 am

    I handle this in CellFormatting event:

        private void OnCellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
            DataGridView dgView = (DataGridView)(sender);
            // no need to add TaskTime...
            if (e.ColumnIndex != dgView.Columns["TaskDate"].Index) return;
            string cellValue = e.Value + " " + dgView.CurrentRow.Cells[dgView.Columns["TaskTime"].Value);
            DateTime dtValue;
            DateTime.TryParse(cellValue, out dtValue);
            DateTime dtValueUTC = TimezoneInfo.ConvertTimeToUtc(dtValue, "Eastern Time Zone");
            e.Value = dtValueUTC.Value.ToLocalTime();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java process that runs on a Windows server where I have
I have an archiving process that basically deletes archived records after a set number
I'm importing Oracle data into SQL Server. After my OLE DB Source that runs
I have a Junit process that runs a bunch of data integrity tests every
I have a process that is converting dates from GMT to Australian Eastern Standard
I have a Process that runs an exe: Process pr = new Process(); pr.StartInfo.FileName
I have a process that runs continuesly. I want to trigger that process every
I have a link from Microsoft Access to a SQL Server table. The I/O
I have a process that runs long, and I want to update a label
I have a process that runs in a thread (used as a realtime signal

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.