Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm using a CoreResultsWebPart to display the latest articles in a short list. To display the last modified Date and Time I've created a Managed Property called LastModifiedDateTime (I'm aware of the existings of LastModifiedTime, but this can't be used.) This works, but not with the expected results, since it only displays the Date and not the Date AND Time.

Creating the Managed Property:

  1. Add New Managed Property

    Property name: LastModifiedDateTime
    Include values from a single crawled property based on the order specified
    Has Multiple Values > Unchecked
    Crawled properties mapped to this managed property:
    Basic:14(Date and Time)
    Basic:16(Date and Time)
    ows_Modified(Date and Time)
    lastaccessed(Date and Time)
    Allow this property to be used in scopes
    Add managed property to custom results set retrieved on each query. Note: Only the first 2 kilobytes of data is available for display by default. > Checked
    
  2. Start full crawl

Display the Managed Property:

  1. Edit CoreResultsWebPart
  2. Add Fetched Properties
  3. Add XSL with the XSL-editor:

XSL

<xsl:for-each select="node()">
    Property:<xsl:value-of select="name()"/> |
    Value:<xsl:value-of select="."/><br/>
</xsl:for-each>

It displays the following result:

... Property:lastmodifieddatetime | Value:28-11-2012 ...

While the expected result was:

... Property:lastmodifieddatetime | Value:28-11-2012 10:34 ...

Any ideas?

Thanks in advance

share|improve this question
add comment

2 Answers

you can create a calculated column(test) with last updated column, do full crawl and find the crawl property ows_test and map that to your new managed property. and specify the new managed property(text) as column in your sortablecoreresultswebpart. you will get something like this

1 12/5/2012 datetime;#2012-12-05T16:26:10Z

you can use xslt to reformat the date and time . hope this helps

share|improve this answer
    
Thanks! This works for displaying the date and time. Unfortunately SharePoint can't sort on this property. –  Farrell Dec 7 '12 at 13:47
add comment

Just because the crawled properties you have mapped to your managed property are of the type "Date and Time" does not mean that they actually have a value that includes a date and time.

Since your mapped property is getting its value from the crawled properties based on their order in the list, I would start by juggling the order of the properties in the list and see if having one of the other crawled properties first (instead of Basic:14) gives you the data you are looking for.

According to this technet article, Basic:14 is mapped to LastModifiedTime, which you said is not working for you.

share|improve this answer
    
Unfortunately I cannot display any Time, only dates. While this property is filled from SharePoint defaults perspective. This behavior sounds very implausible. I guess it's the limitation of the SortableSearchCoreResults ? –  Farrell Dec 5 '12 at 13:19
    
I doubt it has to do with a limitation of the SortableSearchCoreResult. I'm guessing it has to do with either the time data not being in the properties you are trying to get the information from, or that you are not accessing the data in those properties in a way that gets to the data you want. I'm not really familiar with XSL, but maybe you just aren't getting the right value by doing value-of select="." ? Perhaps this can help: stackoverflow.com/questions/6377549/… –  Dylan Cristy Dec 5 '12 at 15:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.