Convert to local date/time when page is rendered?

R

Randall Parker

I realize that methods like DateTime.ToLocalTime() and DateTime.ToUniveralTime() exist.

But suppose one wants to query out data from a database that has UTC times in it.
Suppose one wants to have a DataGrid with BoundColumn rows that are dates and times.
Can one somehow in specifying the formatting for a date column say "date the bound
date and treat it as UTC and convert it to PST when the page is rendered"?

Or does one have to go thru the dataset and do date math on every date column in
every row before doing the DataBind() call?

I'm not even sure whether the database I'm using (MySQL) thinks it is handing me UTC
dates. But I just found out that the data feed I've got comingi in is providing UTC
dates and I'm going to have customers in a few different time zones wanting to look
at forms in theirr time zones.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top