Question: I have a DataView Webpart, to display XML data using XML File connection.

I use the below formula to calculate the day difference between 2 dates:

```
"(number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(Date2)))) - number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(Date1))))) div 864000000000"

```

Now I would like to calculate the Hours and minutes difference between the 2 dates. I'm scratching my head to achieve this. Can anyone help me with this?

Answer: 
I would like to thank anyone that has viewed my question and kindly replied to me. 

The above scripts didn't work for me. I was getting the following error:

> 
> Get-SPSite : A positional parameter cannot be found that accepts
>  argument '$null'. At line:3 char:20
>  + $siteCollections = Get-SPSite –WebApplication "Some-Site
>  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  + CategoryInfo : InvalidArgument: (:) [Get-SPSite], ParameterBindingException
>  + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.SharePoint.PowerShell.SPCmdletGetSite
> 
> 
> 

So the below script works just fine:

```
$feature = Get-SPFeature -Id some-feature-Id

$siteCollections = Get-SPSite –WebApplication Some-Site

foreach($siteCollection in $siteCollections)
{

   Write-Host "Activating" $feature.DisplayName "on" $siteCollection.Url

   Enable-SPFeature $feature -Url $siteCollection.Url 

}

```

To Disable features just replace Enable with Disable
To enable feature on all sites of a particular web application. Use below script

```
Get-SPWebApplication"“<WebApplicationURL>" | Get-SPSite -Limit ALL |ForEach-Object {Enable-SPFeature “MyFeatureID” -Url $_.Url -confirm:$false}’

```

Source <http://www.greggalipeau.com/2011/08/23/sharepoint-2010-powershell-enabledisable-feature-for-all-site-collections/>