<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get-NcSnapMirror LastTransferEndTimestamp to Date in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154549#M3005</link>
    <description>&lt;P&gt;Replacing line 18 in your code with this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; (Get-Date '1970-01-01').AddSeconds($mirror.LastTransferEndTimestamp)&lt;/PRE&gt;
&lt;P&gt;worked in my lab, and yielded output like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;LastTransEnd      : 2/25/2020 7:05:16 AM&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Feb 2020 15:44:09 GMT</pubDate>
    <dc:creator>donny_lang</dc:creator>
    <dc:date>2020-02-25T15:44:09Z</dc:date>
    <item>
      <title>Get-NcSnapMirror LastTransferEndTimestamp to Date</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154538#M3004</link>
      <description>&lt;P&gt;Couple things with this, first I'm wanting to convert the output from LastTransferEndTimestamp to a human readable date.&amp;nbsp; I've read a few articles that demonstrate how to convert the output using get-date and I've had good success but I'm struggling to get the syntax correct to make the conversion on single line nested in foreach loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No struggles here&lt;/P&gt;
&lt;PRE class="lang-bsh prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;PS C&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;\&amp;gt; $date &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Get&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Date&lt;/SPAN&gt; &lt;SPAN class="str"&gt;'1970-01-01'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;).&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;AddSeconds&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;1471979101&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
PS C&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;\&amp;gt; $date&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetDateTimeFormats&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'s'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;08&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;23T19&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;05&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;01&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My questions, how&amp;nbsp; can I achieve the desired result with the code below?&amp;nbsp; I like the flexibility of using the code below but, am I over complicating it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I struggle here.&lt;/P&gt;
&lt;PRE&gt;$mirrors = @()

foreach ($controller in @($controllers)) {
Connect-NcController $controller
# Collect desired volumes from controllers and store in variable
$mirrors += Get-NcSnapmirror -Controller $_ | Where-Object {$_.DestinationVolume -match 'Prod_SQL'}
} #foreach
$reportData = foreach ($mirror in $mirrors) {
    # Create object with values
    [PSCustomObject][ordered]@{
        'Destination_SVM'     = $mirror.DestinationVserver
        'Destination_Vol'           = $mirror.DestinationVolume 
        'Status'           = $mirror.status 
        'LagTime'           = $mirror.LagTime
        'LastTransDuration'     = $mirror.LastTransferDuration
        'LastTransSize_GB'          = $mirror.LastTransferSize / 1tb | % {$_.ToString("#.##")}
        'LastTransError'        =$mirror.LastTransferError
        &lt;FONT color="#FF0000"&gt;'LastTransEnd'        =$mirror.LastTransferEndTimestamp&lt;/FONT&gt;
        'TranferRateMax'        =$mirror.CurrentMaxTransferRate
        'ExportSnapshot'        =$mirror.ExportedSnapshot
        'SnapshotTimestamp'        =$mirror.CurrentMaxTransferRateExportedSnapshotTimestamp
        'Break/fail'      = $mirror.BreakFailedCount
        'CatalogStatus'  = $mirror.CatalogStatus;
         

    }
}&lt;/PRE&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:18:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154538#M3004</guid>
      <dc:creator>brad2020</dc:creator>
      <dc:date>2025-06-04T11:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get-NcSnapMirror LastTransferEndTimestamp to Date</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154549#M3005</link>
      <description>&lt;P&gt;Replacing line 18 in your code with this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; (Get-Date '1970-01-01').AddSeconds($mirror.LastTransferEndTimestamp)&lt;/PRE&gt;
&lt;P&gt;worked in my lab, and yielded output like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;LastTransEnd      : 2/25/2020 7:05:16 AM&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 15:44:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154549#M3005</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-02-25T15:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get-NcSnapMirror LastTransferEndTimestamp to Date</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154556#M3006</link>
      <description>&lt;P&gt;Worked perfectly.&amp;nbsp; Any advice on lag time to represent dd:hh:ss ?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 17:00:56 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154556#M3006</guid>
      <dc:creator>brad2020</dc:creator>
      <dc:date>2020-02-25T17:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get-NcSnapMirror LastTransferEndTimestamp to Date</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154561#M3007</link>
      <description>&lt;P&gt;Line 14 to the right of the equal sign can be replaced with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[Timespan]::FromSeconds($mirror.LagTime) | % {"{0:dd\:hh\:mm\:ss}" -f $_}&lt;/PRE&gt;
&lt;P&gt;It displays like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;LagTime           : 00:09:35:31&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 18:40:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Get-NcSnapMirror-LastTransferEndTimestamp-to-Date/m-p/154561#M3007</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-02-25T18:40:12Z</dc:date>
    </item>
  </channel>
</rss>

