Skip to main content
Improve formatting
Source Link
Tamás Tárnok
  • 4.3k
  • 1
  • 20
  • 33

thisThis format is working for me

$csvDate = [datetime]::ParseExact("23/09/2015 05:41:27","dd/MM/yyyy HH:mm:ss",[Globalization.cultureinfo]::GetCultureInfo("en-US"))

$currentItem["Publish Date"] = [Sitecore.DateUtil]::ToIsoDate($csvDate)

$csvDate = [datetime]::ParseExact("23/09/2015 05:41:27","dd/MM/yyyy HH:mm:ss",[Globalization.cultureinfo]::GetCultureInfo("en-US"))        
$currentItem["Publish Date"] = [Sitecore.DateUtil]::ToIsoDate($csvDate)

this format is working for me

$csvDate = [datetime]::ParseExact("23/09/2015 05:41:27","dd/MM/yyyy HH:mm:ss",[Globalization.cultureinfo]::GetCultureInfo("en-US"))

$currentItem["Publish Date"] = [Sitecore.DateUtil]::ToIsoDate($csvDate)

This format is working for me:

$csvDate = [datetime]::ParseExact("23/09/2015 05:41:27","dd/MM/yyyy HH:mm:ss",[Globalization.cultureinfo]::GetCultureInfo("en-US"))        
$currentItem["Publish Date"] = [Sitecore.DateUtil]::ToIsoDate($csvDate)
Source Link
sindu
  • 639
  • 7
  • 17

this format is working for me

$csvDate = [datetime]::ParseExact("23/09/2015 05:41:27","dd/MM/yyyy HH:mm:ss",[Globalization.cultureinfo]::GetCultureInfo("en-US"))

$currentItem["Publish Date"] = [Sitecore.DateUtil]::ToIsoDate($csvDate)