How to set the Locale of a Network Service (or other System) Account

I had a problem recently with a Sitecore system I was working on. We had 4 machines involved – a development server, a content management server (CM), and two content delivery (CD) servers. The problem was, for the ‘News Search’ page we would get different number of items on the CD servers than the CM or development systems.

2 - Search Filter1 - Search Results Header

CM and Dev would return 8 items for a search of news from 1st April to 30th April. The CDs would return 54 items… Continue reading “How to set the Locale of a Network Service (or other System) Account”

Advertisements
How to set the Locale of a Network Service (or other System) Account

Nintex fn-FormatDate inline function failure

I’m working with a Nintex workflow at the moment, and trying to do a simple thing – format a date. Unfortunately, the function fn-FormatDate does not work correctly.  Continue reading “Nintex fn-FormatDate inline function failure”

Nintex fn-FormatDate inline function failure

Date Formats in XSL with ddwrt

Previously I’ve blogged about using ddwrt to format dates and datetimes. Well, today, I found myself trying to figure it out again, so here is a reminder. Remember, one of the big advantages of this (in the UK at least, where we are UTC time half the year) is that the DateFormat function accounts for daylight savings (i.e. the difference between GMT and BST)

Add this to the xsl:stylesheet tag at the top:

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

Then you can use something like the following (where item_date is an XSL variable with our date in it):

<xsl:value-of select="ddwrt:FormatDate(string($item_date), 2057, 15)" />

Here the FormatDate function is taking the string of the date, formating it for Great Britain’s locale (2057), and specifying an output format (15). Output formats vary by locale, and not all seem to be valid. I found that when I tried a format of ‘2’, for example, that I got an XSL error.

This is a particularly useful with the Content Query Web Part and the RSS Feed Web Part

Date Formats in XSL with ddwrt

Notes on the Microsoft.SharePoint.WebControls.DateTimeControl

It’s quite nice that this control is available to use in my own pages/web parts, but there are issues:

Here we have in microcosm my problems with Microsoft and date/times – an assumption of the local region, and date time controls that would never be empty, right? I had exactly these same problems when writing an Outlook 2003 to SharePoint 2007 integration too. Makes me a bit annoyed! Especially as we have nullable types! Quit screwing around with DateTimes being structs, make them objects and just return me a bloody null if nothing has been selected!

Notes on the Microsoft.SharePoint.WebControls.DateTimeControl

Search Date Formats…

I keep forgetting this, so a note to myself. Date formats in search results in SharePoint are defined by:

  • For Team Sites, the sites Regional Settings
  • For Collaboration Portals, the Search Center’s Regional Settings

Now, if only I can remember that this time. Often I see systems showing the dates in American date format (don’t get me started on that one!) and this is how you change the displayed format.

Of course, this raises the question of, if you have offices in, say, London and Paris, how do you support the different time zones? Hmm. I’ll have to puzzle over that.

Search Date Formats…