Thursday, August 12, 2010 12:42 AM
In SharePoint GUI I created a simple custom list with a calculated Date/Time field (Due). The calculation is =[Created]+7. I'm trying to display this data on a page using a DVWP. But first, for testing purposes, I also created a second calculated Date/Time (TestCreate) field in my custom list that is simply =[Created].
In the List View from within SharePoint, the dates show as expected (for example):
Created = 8/12/2010 3:45 PM
Due = 8/19/2010 3:45 PM
TestCreate = 8/12/2010 3:45 PM
In SharePoint Designer, I added a Data View web part and the above three data elements (each configured to display mm/dd/yyyy hh:mm:ss tt). I see the time displayed for the example list item as:
Created = 8/12/2010 3:45:30 PM
Due = 8/19/2010 10:45:00 AM
TestCreate = 8/12/2010 10:45:00 AM
I've tested a couple scenarios and the calculated fields always display five hours in the past (along with dropping the seconds). It seems like the DVWP is returning the date in a different time zone (with no seconds). The lcid is set right (1033). I didn't see any time zone settings for the DVWP specifically. I'm basically stuck. Could someone help me figure this one out.
Tuesday, August 17, 2010 3:27 AM
I have tested what you have said, but unfortunately I can’t reproduce your issue.
In my local it worked well as expected behavior.
What’s your version of SharePoint? My test Server is 126.96.36.19935.
Hope this helps
Tuesday, August 17, 2010 3:45 PM
We're on 188.8.131.5218. The admin has not upgraded to SP2 yet. Not sure if that would/could make a difference or not. I've replicated this on both test and prod (same version).
Edit: I got access to the Dev server, which is now running 184.108.40.20621. I was able to replicate the problem here as well. The difference in the calculated time is 7:00:xx behind the Create date/time, while I originally reported five hours. I checked on prod and test and it is actually seven hours off.
Wednesday, August 18, 2010 3:05 AM
All date value is displayed based on Time Zone of the site.
you can have a look: Site Settings-->Regional Settings.
so there is a time zone only.
Wednesday, August 18, 2010 2:49 PM
I checked that and both the site and my own regional settings are set correctly to Pacific Time (GMT-8). This is a small single farm, two server configuration with all sites/users located in the Pacific Time zone. The server OS time is set correctly.
In the course of investigating this problem yesterday, we did discover that the time set in the regional settings page in the Central Admin site (not accessible via GUI, but accessible by using _layouts/regionalsetng.aspx URL) was set to Mountain time zone. So at least we can fix that issue.
But I'm still at a loss as to why a calculated date value would display one time in List View and a different time in a DVWP, even though it's the exact same date field. Anyone out there experience this? I can easily replicate this on all three of our systems (dev, test and prod).
Monday, August 30, 2010 6:02 PM
Anyone??? Given that this is easy to replicate on three separate environments here, I can't believe I'm the only one that has run across this. It makes the Data View Web Part difficult to use if your List/Library is using a calculated data field. Seems kind of ridiculous that I need to manually add seven hours to each DVWP calculated date field that I want to display.
Any suggestions or recommendations are welcome. I would really like to get this problem resolved. Thanks.
Friday, February 24, 2012 6:04 PM
Did anyone ever find an answer to this issue? I am also having this problem on a dataview webpart. My field calculations appear to be working correctly, when displayed in a list view. However, when I use the list data in a dataview webpart for setting conditional formats, based on the calculated date values, the dates appear different than the date in the list, by a couple of hours.
Point to note, I'm also running 220.127.116.1121.
- Edited by kwengiel Friday, February 24, 2012 6:22 PM