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 7598729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:28:55+00:00 2026-05-30T22:28:55+00:00

My datetime values are stored as UTC in the database. I want to display

  • 0

My datetime values are stored as UTC in the database. I want to display them in the local timezone using the standard MVC3 WebGrid control, but don’t have a clue how to do that or where to look for the answer.

My current code looks like this:

grid.Column("TestDateTime", "Test Date/Time")

and I know THAT doesn’t work!

Can somebody steer me in the right direction? I do have access to the Telerik controls (free from the local user group) but have not tried them as it seems the more add-ons the more hassle (license fees, updates, keeping several dev environments in synch, etc). If it’s the only way to go I will do it, but would rather get Microsoft’s standard tools to do the job.

Thanks,
Dave

  • 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-30T22:28:56+00:00Added an answer on May 30, 2026 at 10:28 pm

    Try something like :

    grid.Column("DueDate", "Due Date", format: (item) => String.Format("{0:yyyy-MM-dd}", item.DueDate))
    

    you can do pretty much anthing you need afer the format: marker

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

Sidebar

Related Questions

When displaying my DateTime values, I want them to be formatted like so: February
I have a multi-timezone web application that stores all of the datetime values in
I am using Datetime.Minvalue which return 1.1.0001. This value can not be stored to
I have 2 time values which have the type datetime.time . I want to
I need to convert an existing (datetime fields) db from local time ut UTC.
I have a DateTime stored in universal time (UTC) of value 2010-01-01 01:01:01 .
What is the underlying datastructure of datetime values stored in SQL Server (2000 and
My table has a column called date_time where simple DATETIME values are stored. Is
I store datetime values in the database as sql float type (Converted from an
UPDATE I am dealing with a legacy database where the datetime values have been

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.