.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DVWP $Today ignores site timezone setting?

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :SharePoint

Hi. I am using the data view web part to help format list items by comparing a custom date column to the current date. I get the current date by using the $Today parameter that is set by the data view web part from a CAMLVariable parameter.

I have set the site's timezone to GMT so I was expecting $Today to come back as GMT. But it is not, $Today is coming back using the server's timezone which is PST. The problem is, we don't have access to the server so we can't change the timezone. Also, because the $Today date is coming back in PST it means it's impossible to compare it to the dates in the list items which are coming back in GMT.

Has anyone had this problem?

Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool

View Complete Post

More Related Resource Links

rendering today's date through DVWP and modifying the XSLT

I need the Current date or Today to do some simple calculations(calculated columns) such as this: =IF(AND([Due Date]< [today], [today] < ”[Due Date]”),”Red”, “Green”) Question is: To can I convert the above formula so that it works in XSL modifying the XSLT. I new at this and not sure about the syntax. Can anyone help? I am thinking it would be something like this: <xsl:choose> <xsl:when test="ddwrt:Today() &gt; @DueDate"> <xsl:text>Red</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>Green</xsl:text> </xsl:otherwise> </xsl:choose> Obviously something is wrong with the code above...i don't get anything in return.   Thanks Cnothing for members to see

Setting Managed MetaData default values on site creation

I am working on a project where the requirement is to have specific document content types.  I have therefore create a site columns feature which creates all my columns, I have a Site Contentypes feature which creates all my content type and I have list templates based on my content types.  I also have created a couple of Site definition features which create specific list instance based on my list template As part of my content types I have created a few Managed Metadata fields which I wanted to set defaults for on the creation of my sites.  I have therefore created a feature which is right at the end of the WebFeatures section in my ONET.xml.  This features enumerates through all lists, looking for specific column names(managed metadata columns) and looks to set these to specific values.  The code to set the default value on the field is: TaxonomyField documentCategoryField = (TaxonomyField)library.Fields["Document Category"]; if (documentCategoryTerm != null) { documentCategoryField.DefaultValue = documentLibraryDefault.ToString(); documentCategoryField.Update();                                                     }                         &n

The site master page setting currently applied to this site is invalid. Please select a new master p

I have defined a new master page and set it as default for the main site.  Any time I create a new subsite it does not apply the new master page and defaults back to the default.master.  The Site Master Page Settings shows this error. The site master page setting currently applied to this site is invalid. Please select a new master page and apply it The system master page setting currently applied to this site is invalid. Please select a new master page and apply it. Now if I select "Inherit site master page from parent of this site" and "Inherit system master page" and click ok the site will use the new master page and everything is fine.  There is only one modification to the master page that was done so I know the master page isn't invalid.  Does anyone know the answer other than recreating the new master page.

Today() Function including timezone causing issues in Analysis Services

I'm using Reporting Services 2008 R2 connecting to Analysis Services. I've used this same code without issues before (pre R2), just wondering whether it is an RS, AS, Server or some other issue entirely. I have a report with a datetime parameter @vdtmDate (I use this so the user has the date picker instead of a drop down list of dates) with default =DateAdd(DateInterval.Day, -1, Today()) Then in the MDX for the dataset, I use the following to build the filter. SET [Today] as STRTOSET('[Calendar].[Reporting Week].[Day].&[' + VBA.FORMAT(VBA.CDATE(@vdtmDate),'yyyyMMdd') + ']') The issue I'm having is when the report runs with the default parameters, the value passed to Analysis Services includes the timezone which causes the query to process for the previous day to that selected. When the user runs the report manually (ie just pressing the view report button straight after the initial report load) the date passes without the timezone and returns the correct information. Example, running the report today (3rd September), the default parameter passes the value (info from profiler)         <Parameter>           <Name>vdtmDate</Name>           <Value xsi:type="xsd:dateTime">2010-09-02T00:00:00+

Taxonomy term store additions via site setting are not visible to user in RC1

Is see that its possible to define Taxonomy term store via SharePoint main central  admin page. But when I try to add term store entries via a new site in the same collection ....  site setting -> Site Administration -> Term store management any new entries are not visible. That is to say when a user starts to enter a tag the helper dialog does not show any values added via the site but all values add via the central admin do appear. this seems like a bug and the is in RC1 or am I doing something wrong

Setting up Visual Studio with a cloud based SharePoint site

I have a SharePoint site on the cloud where I access it through a URL like this one; https://exampleemeamicrosoftonlinecom-1.sharepoint.emea.microsoftonline.com I can also edit the site with SharePoint Designer by pointing to the same URL. I'm at the stage in the project where I want to do some specific things so I am going to use Visual Studio, but I don't know how to set up Visual Studio with a cloud based SharePoint site? When I go to add a SharePoint site I get the following error; A SharePoint server is not installed on this computer. A SharePoint server must be installed to work with SharePoint projects. I also tried to add the URL as a server in Visual Studio but I get the error; Server name "https://exampleemeamicrosoftonlinecom-1.sharepoint.emea.microsoftonline.com" could not be found. Make sure the server name is correct. I have SharePoint Designer working with the SharePoint site, why won't Visual Studio work?  

Cannot crawl complex URL's without setting a site-wide rule to 'crawl as http content'. Help!

I have pages within a site that use a query string to provide dynamic data to the user (http://<site>/pages/example.aspx?id=1). I can get the content source to index these dynamic pages only if I create a rule which sets the root site (http://<site>/*) to 'include complex urls' and 'crawl sharepoint content as http content'. This is NOT acceptable as changing the crawling protocol from SharePoint's to HTTP will prevent any metadata from being collected on the indexed items. The managed metadata feature is a critical component to our SharePoint applications. To dispel any wondering of whether or not this is simply a configuration error on my part refer to http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/4ff26b26-84ab-4f5f-a14a-48ab7ec121d5 . The issue mentioned is my exact problem but the solution is unusable as I mentioned before. Keep in mind this is for an external publishing site and my search scope is being trimmed using content classes to only include documents/pages (STS_List_850 and STS_ListItem_DocumentLibrary). Creating a new web site content source and adding it to my scope presents 2 problems: duplicate content in scope and no content class defining it that I know of. What options do I have?

Setting sql permissions for web site visitors

Hi all, I have my SqlServer 2005 database at a web host. I recently figured out how to set permissions for the stored procedures (see this link if you face the same problem: http://forums.asp.net/t/1600637.aspx) . Now I wonder: What permissions should I give the web site's visitors? In a stored procedure's Properties window, I have three availabale users, the db owner (the db name), "guest" and "public". My bet is on public.  As far as permission types go, I hev the following available: Alter, Control, Execute, Take Ownership, and View Definition. My guess is that the one of interest is Execute, correct?   In other words, should I set all stored procedures to Execute for public (not that I seem to have the permission to do that myself - I get an error message when I try to alter them)? If so, could I ask the web host to set them globally for me? Or should I only set stored procedure using UPDATE/INSERT/DELETE to Execute?   Thanks a lot for any replies, Pettrer  

Setting up a workflow for comments on a blog site


I created a blog site. Can I set up a workflow process for when a comment is created. The comment MUST be approved/declined before it is posted. Is this possible via the front end?

Thanks, Ninel

Setting up Workflow for comments on a blog site


I created a blog site. Can I set up a workflow process for when a comment is created. The comment MUST be approved/declined before it is posted. Is this possible via the front end?

Thanks, Ninel


Setting SharePoint site URLs


I'm just getting started with SharePoint Foundation 2010 (and ASP.NET as well).  When I go my newly created site at http://machine, the URL is automatically redirected to http://machine/SitePages/Home.aspx.  Could someone explain how this happens?  I don't see a corresponding SitePages\Home.aspx physical path, IIS virtual directories or settings, etc.

How would one change such a URL?  Apparently it's supposed to be under Central Administration->Site Setttings->Look and Feel, but it's playing Waldo on my system.

Thanks for any help.


ASP MVC Site Setting SSL for select pages


I'm trying to figure out how to use SSL for only certain pages on my website.  It's an ecommerce site, and I don't want the whole site to use SSL, only the checkout areas.  I'm not sure what's needed to set this up, is it all IIS, web.config file, etc.

I'm hosting with Discount ASP.Net, and will purcase an SSL cert through them for my site.

Thank you,


10 Mistakes To Avoid In Setting Up An E-commerce Site

According to SearchEngineJournal.com, the main things to avoid in setting up an e-commerce site are: 1. Complicated Checkout 2. Bad Payment Gateway 3. Information Overload 4. No Product Information 5. Not having a good return policy & terms 6. Not Securing Your Site 7. No Products on home page 8. Slow Loading Speed 9. Poor SEO & Marketing 10. Not Up Selling Read the complete blog post here: http://www.searchenginejournal.com/10-mistakes-to-avoid-in-setting-up-an-e-commerce-site/28221/......(read more)

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Take a tour of your SharePoint site

What is a SharePoint site for?
A SharePoint site is a Web site that provides a central storage and collaboration space for documents, information, and ideas. A SharePoint site is a tool for collaboration, just like a telephone is a tool for communication, or a meeting is a tool for decision making. A SharePoint site helps groups of people (whether work teams or social groups) share information and work together. For example, a SharePoint site can help you:

Coordinate projects, calendars, and schedules.
Discuss ideas and review documents or proposals.
Share information and keep in touch with other people.

Six easy ways to customize your site using Web Parts in SharePoint

Becoming familiar with Web Part customization techniques gives you a range of page-customization choices. For example, you can customize your site's home page so that it displays the specific information that your team needs. You can rearrange the list items on the home page, add lists, and even change the images on the home page. As you become more familiar with Web Part Page customization techniques, you can build interactive Web Part Pages that makes the data in lists more dynamic and useful, and you can add new Web Parts that provide access to external data and Web services.

Tips to Improve Your ASP.NET Web site performance

ASP.NET has been developed with lots of features which makes developer life easy. Start from ViewState, PostBack, Server Controls , User Controls and etc. All of them can make your web development experience fun and easy, but improper use of them can cause your site performance slowdown. Most of the controls generate overhead to the client and server. Therefore in this article, I I will list out about things you can do and don't to improve your ASP.NET website performance.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend